help-octave
[Top][All Lists]
Advanced

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

Audio Function Problem


From: Thomas D. Dean
Subject: Audio Function Problem
Date: Fri, 13 Oct 2017 12:16:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

I have a problem with audio functions returning values that seem strange.

getaudiodata () should return values between -1 and 1 but, does not. Seems to be a problem in handling a 24 bit source.

Tom Dean

Script:

## play with xonar u5
1; ## not a function file

devices = audiodevinfo ();
for idx = 1:max(size(devices.input))
  printf("%2d %s\n", devices.input(idx).ID, devices.input(idx).Name);
endfor

seconds = 5

disp("24-bit source============")
source = audiorecorder(192000, 24, 2, 4)
recordblocking (source, seconds);
A = getaudiodata(source);
disp(size(A));
disp(max(A));
disp(min(A));
stop(source);
disp("");
disp("16-bit source============")
source = audiorecorder(192000, 16, 2, 4)
recordblocking (source, seconds);
A = getaudiodata(source);
disp(size(A));
disp(max(A));
disp(min(A));
stop(source);

Output:

octave:36> xonar
 0 HDA Intel PCH: ALC283 Analog (hw:0,0) (ALSA)
 4 ASUS XONAR U5: USB Audio (hw:1,0) (ALSA)
 7 sysdefault (ALSA)
13 default (ALSA)
seconds =  5
24-bit source============
source =

audiorecorder object with properties:

  BitsPerSample =  24
  CurrentSample = 0
  DeviceID =  4
  NumberOfChannels =  2
  Running = off
  SampleRate =  192000
  TotalSamples = 0
  Tag =
  Type = audiorecorder
  UserData = [](0x0)

   960000        2
   0.0011489   0.0012254
  -2  -2

16-bit source============
source =

audiorecorder object with properties:

  BitsPerSample =  16
  CurrentSample = 0
  DeviceID =  4
  NumberOfChannels =  2
  Running = off
  SampleRate =  192000
  TotalSamples = 0
  Tag =
  Type = audiorecorder
  UserData = [](0x0)

   960000        2
   0.0011902   0.0011292
  -0.0010987  -0.0012513



reply via email to

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