Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Recording from mic to mp3

Recording from mic to mp3

Scheduled Pinned Locked Moved C#
tutorial
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Johan Martensson
    wrote on last edited by
    #1

    Hi, Does anyone have an example to get me started on recording to an mp3 file. I want to record from the microphone and save it directly to an mp3. I have a working project but now I save it to wav and then send it to lame and I want to skip that step. Thanks, /Johan

    http://johanmartensson.se - Home of MPEG4Watcher

    F D T 3 Replies Last reply
    0
    • J Johan Martensson

      Hi, Does anyone have an example to get me started on recording to an mp3 file. I want to record from the microphone and save it directly to an mp3. I have a working project but now I save it to wav and then send it to lame and I want to skip that step. Thanks, /Johan

      http://johanmartensson.se - Home of MPEG4Watcher

      F Offline
      F Offline
      Firedragonweb
      wrote on last edited by
      #2

      Hello, the only program i know that streams "directly" to a desired audio format is the VLC Media Player. The good news is, that it is open source and quite well documented. But... it's unmanaged (of course) and i think you will have to dig through quite a bit of code in order to find something useful. Anyway, try this: http://www.videolan.org/developers/vlc.html[^] Michael.

      J 1 Reply Last reply
      0
      • J Johan Martensson

        Hi, Does anyone have an example to get me started on recording to an mp3 file. I want to record from the microphone and save it directly to an mp3. I have a working project but now I save it to wav and then send it to lame and I want to skip that step. Thanks, /Johan

        http://johanmartensson.se - Home of MPEG4Watcher

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        Check this[^] article - it uses the dll from Lame. Creating your own encoder will be a LOT of hard work and probably not possible in C#?

        Dave

        J 1 Reply Last reply
        0
        • F Firedragonweb

          Hello, the only program i know that streams "directly" to a desired audio format is the VLC Media Player. The good news is, that it is open source and quite well documented. But... it's unmanaged (of course) and i think you will have to dig through quite a bit of code in order to find something useful. Anyway, try this: http://www.videolan.org/developers/vlc.html[^] Michael.

          J Offline
          J Offline
          Johan Martensson
          wrote on last edited by
          #4

          Thanks for your answer but I was hoping that there might be a simple library I could use

          http://johanmartensson.se - Home of MPEG4Watcher

          1 Reply Last reply
          0
          • J Johan Martensson

            Hi, Does anyone have an example to get me started on recording to an mp3 file. I want to record from the microphone and save it directly to an mp3. I have a working project but now I save it to wav and then send it to lame and I want to skip that step. Thanks, /Johan

            http://johanmartensson.se - Home of MPEG4Watcher

            T Offline
            T Offline
            Thomas Stockwell
            wrote on last edited by
            #5

            Audacity[^] is an excellent program that does the streaming. It is open-source (not .NET), but it might be an area to start. For encoding to mp3 is uses the lame library mentioned in a previous post.

            Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios Discounted or Free Software for Students: DreamSpark - downloads.channel8.msdn.com MSDN Academic Alliance - www.msdnaa.com

            1 Reply Last reply
            0
            • D DaveyM69

              Check this[^] article - it uses the dll from Lame. Creating your own encoder will be a LOT of hard work and probably not possible in C#?

              Dave

              J Offline
              J Offline
              Johan Martensson
              wrote on last edited by
              #6

              That article does pretty much what I have so far, it takes a wav-file and uses lame to create an mp3. I want to record directly to mp3.

              http://johanmartensson.se - Home of MPEG4Watcher

              D 1 Reply Last reply
              0
              • J Johan Martensson

                That article does pretty much what I have so far, it takes a wav-file and uses lame to create an mp3. I want to record directly to mp3.

                http://johanmartensson.se - Home of MPEG4Watcher

                D Offline
                D Offline
                DaveyM69
                wrote on last edited by
                #7

                AFAIK, I could be wrong (but I've been around the pro audio world for over 20 years) it's not possible. MP3 is an encoding format that compresses existing audio. It's like trying to write data to a zip file without first either saving the file or creating it in memory - the file has to exist somewhere first.

                Dave

                J 1 Reply Last reply
                0
                • D DaveyM69

                  AFAIK, I could be wrong (but I've been around the pro audio world for over 20 years) it's not possible. MP3 is an encoding format that compresses existing audio. It's like trying to write data to a zip file without first either saving the file or creating it in memory - the file has to exist somewhere first.

                  Dave

                  J Offline
                  J Offline
                  Johan Martensson
                  wrote on last edited by
                  #8

                  Yes, I realize it has to created in memory or something like that, so what I'm looking for is a free audio library that takes the data from the mic and sends it directly to lame. My problem is that it must be free for commercial use.

                  http://johanmartensson.se - Home of MPEG4Watcher

                  D 1 Reply Last reply
                  0
                  • J Johan Martensson

                    Yes, I realize it has to created in memory or something like that, so what I'm looking for is a free audio library that takes the data from the mic and sends it directly to lame. My problem is that it must be free for commercial use.

                    http://johanmartensson.se - Home of MPEG4Watcher

                    D Offline
                    D Offline
                    DaveyM69
                    wrote on last edited by
                    #9

                    Just had a quick look at the source code from the article I referenced. It uses its own class WaveStream which takes a Stream in the constructor. I'm pretty sure that would work with a MemoryStream, and if not, I can't imagine it'd be too difficult to ads a new overload to the constructor. Then you could create the wav in memory (MemoryStream) and write directly to disk as mp3.

                    Dave

                    J 1 Reply Last reply
                    0
                    • D DaveyM69

                      Just had a quick look at the source code from the article I referenced. It uses its own class WaveStream which takes a Stream in the constructor. I'm pretty sure that would work with a MemoryStream, and if not, I can't imagine it'd be too difficult to ads a new overload to the constructor. Then you could create the wav in memory (MemoryStream) and write directly to disk as mp3.

                      Dave

                      J Offline
                      J Offline
                      Johan Martensson
                      wrote on last edited by
                      #10

                      You're right, that could absolutely work, I will try it out Thanks for the help everybody

                      http://johanmartensson.se - Home of MPEG4Watcher

                      D 1 Reply Last reply
                      0
                      • J Johan Martensson

                        You're right, that could absolutely work, I will try it out Thanks for the help everybody

                        http://johanmartensson.se - Home of MPEG4Watcher

                        D Offline
                        D Offline
                        DaveyM69
                        wrote on last edited by
                        #11

                        let me know if you get it working. If it's viable I could find a use for it myself!

                        Dave

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups