octave-maintainers
[Top][All Lists]
Advanced

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

Re: Audio playback and classes


From: pantxo diribarne
Subject: Re: Audio playback and classes
Date: Fri, 28 Jun 2013 15:15:49 +0200

As I understand audioplayer documentation, nBits is the representation in which you expect PortAudio to send the data to your output sound hardware. That is thus the type to which you'll have to cast user data before sending theim to the sound card (paInt24 for nBits=24 ...).

nBits is only usefull when userdata are single (clipped between -1->1) or double (idem). As an example, for the following call:

octave:1> data = "" (1,10)*2 - 1;
octave:2> audioplayer (data, 44100, 24);

Your functions workflow will be :
 - compute the data magnitude for output representation (data_out = data * 2^(nBits-1), note we still have double representation here)
 - cast into output format in the c++ function (paInt24 outputdata = (paInt24) userdata)

Pantxo


    


reply via email to

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