DX9 - Playing a streaming sound from a memory stream (not file stream) 
Author Message
 DX9 - Playing a streaming sound from a memory stream (not file stream)

I need to record a sound in from the mic of one sound
card, and play it back through the out of another sound
card.

I can create a capture buffer and the input device.
I then create an IO.MemoryStream which I intend to write
to using the input device on notification of record
position - this all works.

When I come to create the output device the constructor...
bufSoundCardOut = New DirectSound.SecondaryBuffer(stream,
bdPlayback, devSoundCardOutput)

...raises an error 'Index was outside the bounds of the
array.'

I am not sure that a MemoryStream is the right stream to
use, but can find no other stream to use.
I have initialized the BufferDescription with the format I
want to record in.
I am not sure which MemoryStream constructor to use.

My code does work if I use a filestream but this is
obviously no use as I want to stream from another input,
not play back a static file.

Thanks for any help.

PS - It would help if my help files for DX9 didn't all
say 'This is preliminary documentation and is subject to
change' and instead explained what the functions do - is
this due for release soon?



Sun, 31 Jul 2005 23:38:43 GMT  
 DX9 - Playing a streaming sound from a memory stream (not file stream)
If the soundcards are on different PCs you can use
DirectPlay.Voice to trnasfer.. in DX9 SDK has pretty good
tutorial on how to use DirectVoice... You can specify the
compression method and who will listen to waht you are
broadcasting .... look at the tutorials


Tue, 02 Aug 2005 20:12:02 GMT  
 DX9 - Playing a streaming sound from a memory stream (not file stream)
DirectPlay.Voice looks pretty good for network chat, but
sadly no use for what I am trying to achieve...

The two sound cards are on the same PC, and one of them is
virtual. I am simply trying to loop the sound back out of
the real sound card (from the virual sound card) with very
low latency....

I have now managed to achieve this but the buffers depite
being the same format seem to run at slightly different
rates so I get out of sink and end up writing to a part of
the secondary buffer that is being used for playback... I
think I now need some sort of jitter correction but I'm
not sure how to do that.

Quote:
>-----Original Message-----
>If the soundcards are on different PCs you can use
>DirectPlay.Voice to trnasfer.. in DX9 SDK has pretty good
>tutorial on how to use DirectVoice... You can specify the
>compression method and who will listen to waht you are
>broadcasting .... look at the tutorials
>.



Wed, 03 Aug 2005 01:03:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Streaming Wav Audio from a UDP network stream to the sound card

2. ADODB.stream instead of ADODB.Stream

3. ADODB.stream instead of ADODB.Stream??

4. ADODB.stream instead of ADODB.Stream??

5. Play 2 files successively whitout stoping the video stream

6. ADODB.Stream ---file not open ?

7. Sound card data stream access with VB5

8. (VB3) Streaming sound using mmsystem.dll

9. WMS, checking streaming sound

10. Sound card data stream access with VB

11. Sound card data stream access with VB5

12. Sound Streaming in an ActiveX control?

 

 
Powered by phpBB® Forum Software