octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54668] unable to open audio recording stream


From: John Price
Subject: [Octave-bug-tracker] [bug #54668] unable to open audio recording stream
Date: Mon, 17 Sep 2018 01:24:21 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?54668>

                 Summary: unable to open audio recording stream
                 Project: GNU Octave
            Submitted by: jprice
            Submitted on: Mon 17 Sep 2018 05:24:20 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error
                  Status: None
             Assigned to: None
         Originator Name: John Price
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.1
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

I am not sure if this is a bug report or not. Maybe the behavior  I see is
expected for experts, and I just need to be told what the implemented
capabilities are. Code below shows what I am trying to do -- basically 2
channel in and 2 channel out simultaneous audio play and record. 

My hardware is a PreSonus Audiobox 96, which supports quite a few bit rates
but I think only 24 bit width. I cannot make it work -- typically it dies with
"audiorecorder: unable to open audio recording stream". I have tried every
combination of bit width and bit rate, also both MME and DirectSound device
IDs. (audiodevinfo() returns device IDs for both). *Sometimes* it works for a
while with the MME drivers, 16 bits, and 48000 sampling rate, but it is is not
reliable. Sometimes it will run with 24 bits and the DirectSound drivers but
the data it returns is all zeros.

I can make the internal sound card on my desktop (RealTek) work but I really
need mic preamps with XLR inputs.

I could use other hardware, but it would be a big help if someone could tell
me examples that will definitely work. I am using Win 7 but could try other
options.


% script beeper.m
fsamp=48000;

duration=1.1;
ftone=1000;

times=[0:1/fsamp:duration];

beep=0.5*sin(2*pi*ftone*times);

playseries=[beep',beep'];

clear recorded recordedLeft recordedRight
for n = [1:5]
  recorded=playAndRecord(playseries);
  recordedLeft(:,n)=recorded(:,1);
  recordedRight(:,n)=recorded(:,2);
  pause(0.3);
endfor

figure
plot(recordedLeft);
figure
plot(recordedRight);

function recordseries=playAndRecord(playseries)
% interface test code
% use info=audiodevinfo() to get device IDs
% 16 bit MME seems to work, latency about 
fsamp=48000;
bits=24;              
recID=8; recchan=2;      
playID=11; playchan=2;    

recduration = length(playseries)/fsamp;

recorder = audiorecorder(fsamp,bits,recchan,recID);
player = audioplayer(playseries,fsamp,bits,playID);

play(player); 
recordblocking(recorder,recduration);
% record(recorder,recduration);    % not blocking version
                                               
while (isplaying(player))
% while (isplaying(player) || isrecording(recorder))  % not blocking version
endwhile

recordseries=getaudiodata(recorder);

endfunction





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54668>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]