Connecting Tech Pros Worldwide Help | Site Map

Recording at stream

  #1  
Old January 8th, 2009, 04:43 PM
Newbie
 
Join Date: Dec 2008
Posts: 6
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
  #2  
Old January 8th, 2009, 05:30 PM
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,362

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?
  #3  
Old January 8th, 2009, 07:21 PM
Newbie
 
Join Date: Dec 2008
Posts: 6

re: Recording at stream


yeah first thing i try it is that but it does not work , but thanx for replay
  #4  
Old January 8th, 2009, 07:23 PM
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,362

re: Recording at stream


what error do you get? Or what is the result?
  #5  
Old January 8th, 2009, 07:42 PM
Newbie
 
Join Date: Dec 2008
Posts: 6

re: Recording at stream


i get an exception in the recorder libary "openNETCF" without details ..
  #6  
Old January 8th, 2009, 07:47 PM
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,362

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?
  #7  
Old January 8th, 2009, 07:59 PM
Newbie
 
Join Date: Dec 2008
Posts: 6

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 .
  #8  
Old January 9th, 2009, 08:51 PM
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,362

re: Recording at stream


what is the object type of "client"?
  #9  
Old January 9th, 2009, 08:55 PM
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,362

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.
  #10  
Old January 12th, 2009, 06:22 AM
Newbie
 
Join Date: Dec 2008
Posts: 6

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rijndael Decrypt returning escape characters at end of string Mantorok answers 4 November 17th, 2005 08:11 AM
Starting and stopping a background process Paul Hampton answers 0 July 18th, 2005 01:16 AM
Starting and stopping a background process Paul Hampton answers 0 July 18th, 2005 01:16 AM
large image db delemia Jason Murry answers 4 July 17th, 2005 12:51 AM