Connecting Tech Pros Worldwide Help | Site Map

Recording at stream

Newbie
 
Join Date: Dec 2008
Posts: 6
#1: Jan 8 '09
Hi
i want to record voice and send it throw Bluetooth stream , the problem is the recorder accepts only I.O Stream
And write at the 'stream' without using (stream.write),

Expand|Select|Wrap|Line Numbers
  1. ''using openNETCF
  2.  Dim Stream1 As Stream
  3. Stream1 = File.OpenWrite("\My Documents\" & txtFileName.Text & ".wav")
  4. m_Recorder = New OpenNETCF.Media.WaveAudio.Recorder
  5. m_Recorder.RecordFor(Stream1, 5400,OpenNETCF.Media.WaveAudio.SoundFormats.Stereo16bit11kHz) '' accept only i.o stream and record into it
  6.  
The Bluetooth stream I could write byte

Expand|Select|Wrap|Line Numbers
  1. ''using InTheHand 32feet.NET
  2. dim Buffer1 As Byte
  3. Dim stream As System.IO.Stream = Nothing
  4. stream = client.GetStream()  '' return i.o stream 
  5. stream.Write(Buffer1, 0, BufferLen)
  6.  
How to connected them so I could record and write at the same time (could I use memorystream)

Thanks
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,387
#2: Jan 8 '09

re: Recording at stream


Quote:

Originally Posted by fevos View Post

Hi
i want to record voice and send it throw Bluetooth stream , the problem is the recorder accepts only I.O Stream
And write at the 'stream' without using (stream.write),

Expand|Select|Wrap|Line Numbers
  1. ''using openNETCF
  2.  Dim Stream1 As Stream
  3. Stream1 = File.OpenWrite("\My Documents\" & txtFileName.Text & ".wav")
  4. m_Recorder = New OpenNETCF.Media.WaveAudio.Recorder
  5. m_Recorder.RecordFor(Stream1, 5400,OpenNETCF.Media.WaveAudio.SoundFormats.Stereo16bit11kHz) '' accept only i.o stream and record into it
  6.  
The Bluetooth stream I could write byte

Expand|Select|Wrap|Line Numbers
  1. ''using InTheHand 32feet.NET
  2. dim Buffer1 As Byte
  3. Dim stream As System.IO.Stream = Nothing
  4. stream = client.GetStream()  '' return i.o stream 
  5. stream.Write(Buffer1, 0, BufferLen)
  6.  
How to connected them so I could record and write at the same time (could I use memorystream)

Thanks

Have you tried
Expand|Select|Wrap|Line Numbers
  1. m_Recorder.RecordFor(client.GetStream(), 5400,OpenNETCF.Media.WaveAudio.SoundFormats.Stereo16bit11kHz)
Just replace the file writer stream with the IO stream. Wouldn't that work?
Newbie
 
Join Date: Dec 2008
Posts: 6
#3: Jan 8 '09

re: Recording at stream


yeah first thing i try it is that but it does not work , but thanx for replay
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,387
#4: Jan 8 '09

re: Recording at stream


what error do you get? Or what is the result?
Newbie
 
Join Date: Dec 2008
Posts: 6
#5: Jan 8 '09

re: Recording at stream


i get an exception in the recorder libary "openNETCF" without details ..
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,387
#6: Jan 8 '09

re: Recording at stream


wait if Client.GetStream() returns an IO stream and OpenNETCF.Media.WaveAudio.Recorder.RecordFor(...) takes and IO stream as it's first argument then what is the problem?

Do you have some documentation for the openNETCF package?
Newbie
 
Join Date: Dec 2008
Posts: 6
#7: Jan 8 '09

re: Recording at stream


yes this the link openNETCF wav(i use recorder), and this the link for 32feet.net theat return client stream ,,,thanx man i appreciate your help .
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,387
#8: Jan 9 '09

re: Recording at stream


what is the object type of "client"?
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,387
#9: Jan 9 '09

re: Recording at stream


Nevermind I found it. client.GetStream() returns a type of NetworkStream which is a type of IO stream but I think you should try explicitly casting it as an IO stream.
Newbie
 
Join Date: Dec 2008
Posts: 6
#10: Jan 12 '09

re: Recording at stream


thanks man , but it give me the same exception , i start new thread about Waveform Audio that record to buffer i hope I'll get your help there thank u so much ..
Reply