Recording at stream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fevos
    New Member
    • Dec 2008
    • 6

    Recording at stream

    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),

    Code:
    ''using openNETCF
     Dim Stream1 As Stream
    Stream1 = File.OpenWrite("\My Documents\" & txtFileName.Text & ".wav")
    m_Recorder = New OpenNETCF.Media.WaveAudio.Recorder
    m_Recorder.RecordFor(Stream1, 5400,OpenNETCF.Media.WaveAudio.SoundFormats.Stereo16bit11kHz) '' accept only i.o stream and record into it
    The Bluetooth stream I could write byte

    Code:
    ''using InTheHand 32feet.NET
    dim Buffer1 As Byte
    Dim stream As System.IO.Stream = Nothing
    stream = client.GetStream()  '' return i.o stream 
    stream.Write(Buffer1, 0, BufferLen)
    How to connected them so I could record and write at the same time (could I use memorystream)

    Thanks
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by fevos
    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),

    Code:
    ''using openNETCF
     Dim Stream1 As Stream
    Stream1 = File.OpenWrite("\My Documents\" & txtFileName.Text & ".wav")
    m_Recorder = New OpenNETCF.Media.WaveAudio.Recorder
    m_Recorder.RecordFor(Stream1, 5400,OpenNETCF.Media.WaveAudio.SoundFormats.Stereo16bit11kHz) '' accept only i.o stream and record into it
    The Bluetooth stream I could write byte

    Code:
    ''using InTheHand 32feet.NET
    dim Buffer1 As Byte
    Dim stream As System.IO.Stream = Nothing
    stream = client.GetStream()  '' return i.o stream 
    stream.Write(Buffer1, 0, BufferLen)
    How to connected them so I could record and write at the same time (could I use memorystream)

    Thanks
    Have you tried
    Code:
    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?

    Comment

    • fevos
      New Member
      • Dec 2008
      • 6

      #3
      yeah first thing i try it is that but it does not work , but thanx for replay

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        what error do you get? Or what is the result?

        Comment

        • fevos
          New Member
          • Dec 2008
          • 6

          #5
          i get an exception in the recorder libary "openNETCF" without details ..

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            wait if Client.GetStrea m() returns an IO stream and OpenNETCF.Media .WaveAudio.Reco rder.RecordFor( ...) takes and IO stream as it's first argument then what is the problem?

            Do you have some documentation for the openNETCF package?

            Comment

            • fevos
              New Member
              • Dec 2008
              • 6

              #7
              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 .

              Comment

              • RedSon
                Recognized Expert Expert
                • Jan 2007
                • 4980

                #8
                what is the object type of "client"?

                Comment

                • RedSon
                  Recognized Expert Expert
                  • Jan 2007
                  • 4980

                  #9
                  Nevermind I found it. client.GetStrea m() 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.

                  Comment

                  • fevos
                    New Member
                    • Dec 2008
                    • 6

                    #10
                    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 ..

                    Comment

                    Working...