[Portaudio] Playing 2 audio files at a time using ocacapture

Guruswamy B M guruswamy.1984 at gmail.com
Wed Apr 11 00:32:26 EDT 2012


Hi Ross,
Now I can able to play multiple audio files on each channel with
single stream as you suggested by using ASIO host api. I have used
non-interleave buffers in call back function to handle this.

Now I need to record the all the channel data similar way. I did tried
below steps

1. Tried similar way (non-interleave buffers) to record the data on
each channel, but nothing is recording.

2. Used the channle selectors in
AsioInputInfo(InputParameters.hostApiSpecificStreamInfo =
&asioInputInfo);, in this case I am able to record the particular
channel data which I sent in channel selector.

I didnt get any examples and tests related to recording in (/examples
and /test folder),  So please suggest how can I record all the
channels, at a time using single stream.

Regards,
Guru



On 3/21/12, Ross Bencina <rossb-lists at audiomulch.com> wrote:
> Hello Guruswamy,
>
> On 21/03/2012 6:08 PM, Guruswamy B M wrote:
>> Hi Ross,
>> Thanks for the input.
>> Now I am able to open multiple open stream  by using windows direct
>> source host API. So now I can play a two audio files on different
>> channels  (EX: audio 1 in Octa capture ports (5,6) and audio 2 in Octa
>> capture ports (3,4)).
>
> Well that is not what I suggested. I suggested that you open a single
> stream with all channels and then copy data to the channels you need.
>
> You should have only one Pa_OpenStream() call in your code.
>
>> But now I am limited to channels available, I wanted to tune my code
>> like this. Play audio file1 in Octa capture (3) and Play audio file1 in
>> Octa capture (4). By doing this I can effectively use other channels
>> instead of using one complete channel  pair for one audio file (Say 3, 4)
>  >
>> I have seen the example for masking the channel for ASIO not for direct
>> source.
>
> This is not the answer. Open the stream once and then play all of your
> files out through one PA stream. Implement the channel allocation yourself.
>
>
>> So can you pls explain how to mask the channel in direct source host
>> api. Say in my example audio file1 for port 3 and audio file 2  for port
>> 4.
>
> I'm not going to explain it because it is not the way to do it.
>
> Ross.
>
>
>> Regards,
>> Guru
>>
>>
>>
>> On Mon, Mar 12, 2012 at 2:13 AM, Ross Bencina
>> <rossb-lists at audiomulch.com <mailto:rossb-lists at audiomulch.com>> wrote:
>>
>>     Hi Guru,
>>
>>
>>     On 12/03/2012 2:24 AM, Guruswamy B M wrote:
>>
>>         Hi Ross,
>>         No, I didnt know how to open the device with more than 2 channel.
>>
>>         I have attached the source code which I am using, is works well
>>         for one
>>         channel i.e., I am using two sets of octacapture ports for (one
>>         set of
>>         channel (octacapture ports (4, 5) for playing the file and other
>>         set of
>>         channel (octacapture ports (3,4) for recording it), through
>>         "playAndRecordFile" function.
>>
>>
>>     Sorry I don't have time to look at your code right now.
>>
>>
>>         For multiple audio I did try this, open the stream for first
>>         audio file,
>>         and if open stream returns success, then trying to opening the
>>         stream
>>         for second audio files, but I am getting device not enable error
>>         (error
>>         code -5) in "Pa_OpenStream" function.
>>
>>
>>     Some host APIs don't let you open the same device more than once.
>>     That is expected.
>>
>>
>>
>>         And you have mentioned "Open the stream with all channels.
>>
>>
>>     There are examples and tests (in /examples and /tests) that
>>     demonstrate multichannel usage. You need to pass the correct number
>>     of channels when you call Pa_OpenStream, see the documentation for
>>     details.
>>
>>
>>
>>         Output silence to the channels you don't need.
>>
>>
>>     Just copy 0 to the sample locations for the channels you don't use
>>
>>
>>
>>         Output audio to the channels you wish to target."
>>
>>
>>     Copy your audio data to the sample locations you do use. You need to
>>     understand how the audio data is interleaved or placed in separate
>>     buffers. Once again, check the multichannel examples/tests for
>> details.
>>
>>     Ross.
>>
>>
>>
>>         So could you please explain the how to do this in port audio
>>
>>         Thanks in advance,
>>         Guru
>>
>>         On Sun, Mar 11, 2012 at 12:37 PM, Ross Bencina
>>         <rossb-lists at audiomulch.com <mailto:rossb-lists at audiomulch.com>
>>         <mailto:rossb-lists at __audiomulch.com
>>         <mailto:rossb-lists at audiomulch.com>>> wrote:
>>
>>
>>             On 11/03/2012 4:00 PM, Guruswamy B M wrote:
>>
>>                 Hi,
>>                 I am able play a audio using port audio code through
>>         octacapture.
>>
>>
>>             Do you understand how to open the device with more than 2
>>         channels?
>>
>>             Do you understand how to output your single file to any
>>         combination
>>             of channels? (ie copy to the appropriate interleave channels
>> or
>>             non-interleave buffers).
>>
>>
>>
>>                 Now my next task is to play a multiple audio files at a
>>         time.
>>                 (EX: audio
>>                 1 in Octa capture ports (5,6) and audio 2 in Octa
>>         capture ports
>>                 (3,4)).
>>                 How can we achieve this through port audio code?
>>
>>
>>             Open the stream with all channels.
>>
>>             Output silence to the channels you don't need.
>>
>>             Output audio to the channels you wish to target.
>>
>>
>>
>>                 We can play multiple audio by using the tools like
>>         audobe audition.
>>                 Which will play audios simultaneously on different
>>         octacapture
>>                 ports.
>>                 Similar way I wanted to do in port audio code.
>>
>>          >
>>
>>                 Any help regarding this highly appreciated.
>>
>>                 Thanks and regards,
>>                 Guru
>>
>>
>>
>>                 ___________________________________________________
>>                 Portaudio mailing list
>>         Portaudio at music.columbia.edu
>>         <mailto:Portaudio at music.columbia.edu>
>>         <mailto:Portaudio at music.__columbia.edu
>>         <mailto:Portaudio at music.columbia.edu>>
>>         http://music.columbia.edu/____mailman/listinfo/portaudio
>>         <http://music.columbia.edu/__mailman/listinfo/portaudio>
>>         <http://music.columbia.edu/__mailman/listinfo/portaudio
>>         <http://music.columbia.edu/mailman/listinfo/portaudio>>
>>
>>             ___________________________________________________
>>             Portaudio mailing list
>>         Portaudio at music.columbia.edu
>>         <mailto:Portaudio at music.columbia.edu>
>>         <mailto:Portaudio at music.__columbia.edu
>>         <mailto:Portaudio at music.columbia.edu>>
>>         http://music.columbia.edu/____mailman/listinfo/portaudio
>>         <http://music.columbia.edu/__mailman/listinfo/portaudio>
>>
>>         <http://music.columbia.edu/__mailman/listinfo/portaudio
>>         <http://music.columbia.edu/mailman/listinfo/portaudio>>
>>
>>
>>
>>
>>         _________________________________________________
>>         Portaudio mailing list
>>         Portaudio at music.columbia.edu <mailto:Portaudio at music.columbia.edu>
>>         http://music.columbia.edu/__mailman/listinfo/portaudio
>>         <http://music.columbia.edu/mailman/listinfo/portaudio>
>>
>>     _________________________________________________
>>     Portaudio mailing list
>>     Portaudio at music.columbia.edu <mailto:Portaudio at music.columbia.edu>
>>     http://music.columbia.edu/__mailman/listinfo/portaudio
>>     <http://music.columbia.edu/mailman/listinfo/portaudio>
>>
>>
>>
>>
>> _______________________________________________
>> Portaudio mailing list
>> Portaudio at music.columbia.edu
>> http://music.columbia.edu/mailman/listinfo/portaudio
>


More information about the Portaudio mailing list