virtual microphone: File -> Microphone -> Application












1















I need debug my program and I need something like a virtual
microphone. I would like device "microphone" where I can put sound file and
this file will be input for microphone stream. And in application I get this
stream from this "microphone"



File -> Microphone -> Application



is it possible?



something like bash command should by very very useful:



aplay --device=mic my_microphone.wav to run a microphone stream










share|improve this question





























    1















    I need debug my program and I need something like a virtual
    microphone. I would like device "microphone" where I can put sound file and
    this file will be input for microphone stream. And in application I get this
    stream from this "microphone"



    File -> Microphone -> Application



    is it possible?



    something like bash command should by very very useful:



    aplay --device=mic my_microphone.wav to run a microphone stream










    share|improve this question



























      1












      1








      1


      2






      I need debug my program and I need something like a virtual
      microphone. I would like device "microphone" where I can put sound file and
      this file will be input for microphone stream. And in application I get this
      stream from this "microphone"



      File -> Microphone -> Application



      is it possible?



      something like bash command should by very very useful:



      aplay --device=mic my_microphone.wav to run a microphone stream










      share|improve this question
















      I need debug my program and I need something like a virtual
      microphone. I would like device "microphone" where I can put sound file and
      this file will be input for microphone stream. And in application I get this
      stream from this "microphone"



      File -> Microphone -> Application



      is it possible?



      something like bash command should by very very useful:



      aplay --device=mic my_microphone.wav to run a microphone stream







      linux microphone






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 16 '14 at 19:03









      Cfinley

      1,43331120




      1,43331120










      asked Feb 13 '11 at 15:50









      user67449user67449

      612




      612






















          2 Answers
          2






          active

          oldest

          votes


















          0














          Your question lacks a few details, such as which programming language or which sound server you are using. Still, I'll give it a try.



          I have successfully used the JACK daemon (jackd) to debug an audio application. It might be a bit of work to get jackd to work, but it's worth it. Think of it as a sound server that audio applications and hardware can register audio input and output ports with. Then you may use qjackctl to connect these ports, either manually using Connect or automatically using the Patchbay.



          The steps to follow:




          • install jackd and qjackctl

          • supposing that you're using ALSA, add a device jack to your ~/.asoundrc so you can output to the jack server (see below)

          • start qjackctl and from inside, start jackd (this might be the time where you run into problems - in my rather complex audio setup, I had to move pulseaudio out of the way)

          • play your sound file using aplay --device=jack my_microphone.wav and try to connect it to your sound card - when you hear something, you're almost done

          • create a new JACK input port using the JACK API

          • use jackd's Patchbay to automatically connect your new input port to a JACK audio output port (which may the output from aplay, a media player using JACK (qmmp, VLC and others) or your sound card)


          Here's the relevant part of my ~/.asoundrc



          pcm.jack
          {
          type plug
          slave.pcm "jack_output"
          hint
          {
          show on
          description "Alsa (JACK plugin)"
          }
          }

          pcm.jack_output
          {
          type jack
          playback_ports
          {
          0 system:playback_1
          1 system:playback_2
          }
          capture_ports
          {
          0 system:capture_1
          1 system:capture_2
          }
          hint
          {
          show off
          description "Alsa (JACK output)"
          }
          }





          share|improve this answer































            0














            You can also incorporate GStreamer in your application. See here for a short introduction and here for a tutorial. The element appsink might be just what you're looking for.



            Here are some command line examples. There's also an extensive API so you can call all (or part) of this from your application.



            Playback pink noise on your default audio output:



            gst-launch-0.10 audiotestsrc wave=6 ! autoaudiosink


            Playback an MP3 (or other supported format) on your default audio output:



            gst-launch-0.10 filesrc location=my_microphone.mp3 ! decodebin ! 
            audioconvert ! autoaudiosink


            GStreamer is brilliant, so please don't blame me in case you start re-writing your whole application using GStreamer... :)






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f245312%2fvirtual-microphone-file-microphone-application%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Your question lacks a few details, such as which programming language or which sound server you are using. Still, I'll give it a try.



              I have successfully used the JACK daemon (jackd) to debug an audio application. It might be a bit of work to get jackd to work, but it's worth it. Think of it as a sound server that audio applications and hardware can register audio input and output ports with. Then you may use qjackctl to connect these ports, either manually using Connect or automatically using the Patchbay.



              The steps to follow:




              • install jackd and qjackctl

              • supposing that you're using ALSA, add a device jack to your ~/.asoundrc so you can output to the jack server (see below)

              • start qjackctl and from inside, start jackd (this might be the time where you run into problems - in my rather complex audio setup, I had to move pulseaudio out of the way)

              • play your sound file using aplay --device=jack my_microphone.wav and try to connect it to your sound card - when you hear something, you're almost done

              • create a new JACK input port using the JACK API

              • use jackd's Patchbay to automatically connect your new input port to a JACK audio output port (which may the output from aplay, a media player using JACK (qmmp, VLC and others) or your sound card)


              Here's the relevant part of my ~/.asoundrc



              pcm.jack
              {
              type plug
              slave.pcm "jack_output"
              hint
              {
              show on
              description "Alsa (JACK plugin)"
              }
              }

              pcm.jack_output
              {
              type jack
              playback_ports
              {
              0 system:playback_1
              1 system:playback_2
              }
              capture_ports
              {
              0 system:capture_1
              1 system:capture_2
              }
              hint
              {
              show off
              description "Alsa (JACK output)"
              }
              }





              share|improve this answer




























                0














                Your question lacks a few details, such as which programming language or which sound server you are using. Still, I'll give it a try.



                I have successfully used the JACK daemon (jackd) to debug an audio application. It might be a bit of work to get jackd to work, but it's worth it. Think of it as a sound server that audio applications and hardware can register audio input and output ports with. Then you may use qjackctl to connect these ports, either manually using Connect or automatically using the Patchbay.



                The steps to follow:




                • install jackd and qjackctl

                • supposing that you're using ALSA, add a device jack to your ~/.asoundrc so you can output to the jack server (see below)

                • start qjackctl and from inside, start jackd (this might be the time where you run into problems - in my rather complex audio setup, I had to move pulseaudio out of the way)

                • play your sound file using aplay --device=jack my_microphone.wav and try to connect it to your sound card - when you hear something, you're almost done

                • create a new JACK input port using the JACK API

                • use jackd's Patchbay to automatically connect your new input port to a JACK audio output port (which may the output from aplay, a media player using JACK (qmmp, VLC and others) or your sound card)


                Here's the relevant part of my ~/.asoundrc



                pcm.jack
                {
                type plug
                slave.pcm "jack_output"
                hint
                {
                show on
                description "Alsa (JACK plugin)"
                }
                }

                pcm.jack_output
                {
                type jack
                playback_ports
                {
                0 system:playback_1
                1 system:playback_2
                }
                capture_ports
                {
                0 system:capture_1
                1 system:capture_2
                }
                hint
                {
                show off
                description "Alsa (JACK output)"
                }
                }





                share|improve this answer


























                  0












                  0








                  0







                  Your question lacks a few details, such as which programming language or which sound server you are using. Still, I'll give it a try.



                  I have successfully used the JACK daemon (jackd) to debug an audio application. It might be a bit of work to get jackd to work, but it's worth it. Think of it as a sound server that audio applications and hardware can register audio input and output ports with. Then you may use qjackctl to connect these ports, either manually using Connect or automatically using the Patchbay.



                  The steps to follow:




                  • install jackd and qjackctl

                  • supposing that you're using ALSA, add a device jack to your ~/.asoundrc so you can output to the jack server (see below)

                  • start qjackctl and from inside, start jackd (this might be the time where you run into problems - in my rather complex audio setup, I had to move pulseaudio out of the way)

                  • play your sound file using aplay --device=jack my_microphone.wav and try to connect it to your sound card - when you hear something, you're almost done

                  • create a new JACK input port using the JACK API

                  • use jackd's Patchbay to automatically connect your new input port to a JACK audio output port (which may the output from aplay, a media player using JACK (qmmp, VLC and others) or your sound card)


                  Here's the relevant part of my ~/.asoundrc



                  pcm.jack
                  {
                  type plug
                  slave.pcm "jack_output"
                  hint
                  {
                  show on
                  description "Alsa (JACK plugin)"
                  }
                  }

                  pcm.jack_output
                  {
                  type jack
                  playback_ports
                  {
                  0 system:playback_1
                  1 system:playback_2
                  }
                  capture_ports
                  {
                  0 system:capture_1
                  1 system:capture_2
                  }
                  hint
                  {
                  show off
                  description "Alsa (JACK output)"
                  }
                  }





                  share|improve this answer













                  Your question lacks a few details, such as which programming language or which sound server you are using. Still, I'll give it a try.



                  I have successfully used the JACK daemon (jackd) to debug an audio application. It might be a bit of work to get jackd to work, but it's worth it. Think of it as a sound server that audio applications and hardware can register audio input and output ports with. Then you may use qjackctl to connect these ports, either manually using Connect or automatically using the Patchbay.



                  The steps to follow:




                  • install jackd and qjackctl

                  • supposing that you're using ALSA, add a device jack to your ~/.asoundrc so you can output to the jack server (see below)

                  • start qjackctl and from inside, start jackd (this might be the time where you run into problems - in my rather complex audio setup, I had to move pulseaudio out of the way)

                  • play your sound file using aplay --device=jack my_microphone.wav and try to connect it to your sound card - when you hear something, you're almost done

                  • create a new JACK input port using the JACK API

                  • use jackd's Patchbay to automatically connect your new input port to a JACK audio output port (which may the output from aplay, a media player using JACK (qmmp, VLC and others) or your sound card)


                  Here's the relevant part of my ~/.asoundrc



                  pcm.jack
                  {
                  type plug
                  slave.pcm "jack_output"
                  hint
                  {
                  show on
                  description "Alsa (JACK plugin)"
                  }
                  }

                  pcm.jack_output
                  {
                  type jack
                  playback_ports
                  {
                  0 system:playback_1
                  1 system:playback_2
                  }
                  capture_ports
                  {
                  0 system:capture_1
                  1 system:capture_2
                  }
                  hint
                  {
                  show off
                  description "Alsa (JACK output)"
                  }
                  }






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 6 '11 at 11:12









                  mzuthermzuther

                  1784




                  1784

























                      0














                      You can also incorporate GStreamer in your application. See here for a short introduction and here for a tutorial. The element appsink might be just what you're looking for.



                      Here are some command line examples. There's also an extensive API so you can call all (or part) of this from your application.



                      Playback pink noise on your default audio output:



                      gst-launch-0.10 audiotestsrc wave=6 ! autoaudiosink


                      Playback an MP3 (or other supported format) on your default audio output:



                      gst-launch-0.10 filesrc location=my_microphone.mp3 ! decodebin ! 
                      audioconvert ! autoaudiosink


                      GStreamer is brilliant, so please don't blame me in case you start re-writing your whole application using GStreamer... :)






                      share|improve this answer




























                        0














                        You can also incorporate GStreamer in your application. See here for a short introduction and here for a tutorial. The element appsink might be just what you're looking for.



                        Here are some command line examples. There's also an extensive API so you can call all (or part) of this from your application.



                        Playback pink noise on your default audio output:



                        gst-launch-0.10 audiotestsrc wave=6 ! autoaudiosink


                        Playback an MP3 (or other supported format) on your default audio output:



                        gst-launch-0.10 filesrc location=my_microphone.mp3 ! decodebin ! 
                        audioconvert ! autoaudiosink


                        GStreamer is brilliant, so please don't blame me in case you start re-writing your whole application using GStreamer... :)






                        share|improve this answer


























                          0












                          0








                          0







                          You can also incorporate GStreamer in your application. See here for a short introduction and here for a tutorial. The element appsink might be just what you're looking for.



                          Here are some command line examples. There's also an extensive API so you can call all (or part) of this from your application.



                          Playback pink noise on your default audio output:



                          gst-launch-0.10 audiotestsrc wave=6 ! autoaudiosink


                          Playback an MP3 (or other supported format) on your default audio output:



                          gst-launch-0.10 filesrc location=my_microphone.mp3 ! decodebin ! 
                          audioconvert ! autoaudiosink


                          GStreamer is brilliant, so please don't blame me in case you start re-writing your whole application using GStreamer... :)






                          share|improve this answer













                          You can also incorporate GStreamer in your application. See here for a short introduction and here for a tutorial. The element appsink might be just what you're looking for.



                          Here are some command line examples. There's also an extensive API so you can call all (or part) of this from your application.



                          Playback pink noise on your default audio output:



                          gst-launch-0.10 audiotestsrc wave=6 ! autoaudiosink


                          Playback an MP3 (or other supported format) on your default audio output:



                          gst-launch-0.10 filesrc location=my_microphone.mp3 ! decodebin ! 
                          audioconvert ! autoaudiosink


                          GStreamer is brilliant, so please don't blame me in case you start re-writing your whole application using GStreamer... :)







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 6 '11 at 11:34









                          mzuthermzuther

                          1784




                          1784






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f245312%2fvirtual-microphone-file-microphone-application%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              How do I know what Microsoft account the skydrive app is syncing to?

                              Grease: Live!

                              When does type information flow backwards in C++?