How to change audio capture devices sample rate

I am going to develop a online voice chat applet. Now everything works fine. But I didn't find anyway to capture audio in a lower sample rate. The default sample rate is 441000Hz. I am using MediaLocator to capture audio and pass it into Processor.
MediaLocator ml = new MediaLocator("dsound://");
DataSource ds;
DataSource clone;
try {          
ds = javax.media.Manager.createDataSource(locator);
} catch (Exception e) {
return "Couldn't create DataSource"+e.getMessage();

Use GSM format and do it with setting of BitRateControl. It is better than convert the sample rate of your capturing device. I suppose that you try to reduce load of network traffic with changing sample rate, right?
Best regards from Germany,
r.v.

Similar Messages

  • How to chang audio-output-device(s) in Windwos 8

    Hi,
    currently I’m working on an application that starts by changing the audio-output-device and ends with re-setting the old one.
    On Windows XP I do this by changing the Registry-entry “Sound-Mapper” and it works quite well.
    I hopefully assume it works on all Windows Systems from XP to Windows 7.
    The background is that our program is supposed to play certain multi-channel sounds over an external USB-multichannel-soundcard and it should switch to that device on start. To actually play the sounds we use the AxWindowsMediaPlayer-Class
    to integrate the Windows-Media-Player in our application.
    However, on Windows 8, it is possible to set multiple Audio-Outputs and the Windows-Media-player has a setting to choose from them (under Options). I was unable to use the Registry-trick to switch the output-device and I could not find
    a way to programmatically tell the AxWindowsMediaPlayer to choose the USB-soundcard as an output.
    Is there a Way to programmatically(c#) ether change the audio-output-device(s) in Windos8 or to tell
    AxWindowsMediaPlayer to use a certain device?
    Thank you.

    Hi Kristin,
    I think your reply pushed me in the right direction.
    The waveOutOpen-function is part of the
    winmm.dll-API and I think, that API is the solution to my Problem.
    Unfortunately I am stuck at this point. I tried mciSendString and mciSendComand. Both are cappable of playing sound, but I am unable to change the output Device.
    This is my c# code to open a WAV-File via mciSendCommand:
    MCI_OPEN_PARMS open = new MCI_OPEN_PARMS();
    open.wDeviceID = 0;//this is somehow ignored
    open.lpstrDeviceType = Marshal.StringToHGlobalAnsi("waveaudio");
    open.lpstrElementName = Marshal.StringToHGlobalAnsi(@"test.wav");
    IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MCI_OPEN_PARMS)));
    Marshal.StructureToPtr(open, ptr, false);
    mciSendCommand(Convert.ToUInt32(textBox2.Text),               
    MCI_OPEN,              
    MCI_WAIT | MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,              
    ptr);
    Afterwards I use mciSendCommand to start the playing of the sound, which works fine, but no matter what I enter in the “open.wDeviceID”-Line, I always get sound over
    the default output.
    I use waveOutGetDevCaps to get the number and kind of the output-Devices and this works fine.
    Regards, Marc

  • How do you select two audio capture devices?

    Hi all,
    At the moment I'm simply using CaptureDeviceManager.getDeviceList to get a list of all the capture devices on my system. Now when I print this it looks like this...
    [DirectSoundCapture : dsound://
    LINEAR, 48000.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 48000.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 48000.0 Hz, 8-bit, Stereo, Unsigned
    LINEAR, 48000.0 Hz, 8-bit, Mono, Unsigned
    LINEAR, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 44100.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 44100.0 Hz, 8-bit, Stereo, Unsigned
    LINEAR, 44100.0 Hz, 8-bit, Mono, Unsigned
    LINEAR, 32000.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 32000.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 32000.0 Hz, 8-bit, Stereo, Unsigned
    LINEAR, 32000.0 Hz, 8-bit, Mono, Unsigned
    LINEAR, 22050.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 22050.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 22050.0 Hz, 8-bit, Stereo, Unsigned
    LINEAR, 22050.0 Hz, 8-bit, Mono, Unsigned
    LINEAR, 16000.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 16000.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 16000.0 Hz, 8-bit, Stereo, Unsigned
    LINEAR, 16000.0 Hz, 8-bit, Mono, Unsigned
    LINEAR, 11025.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 11025.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 11025.0 Hz, 8-bit, Stereo, Unsigned
    LINEAR, 11025.0 Hz, 8-bit, Mono, Unsigned
    LINEAR, 8000.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 8000.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 8000.0 Hz, 8-bit, Stereo, Unsigned
    LINEAR, 8000.0 Hz, 8-bit, Mono, Unsigned
    , JavaSound audio capture : javasound://44100
    LINEAR, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 44100.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 22050.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 22050.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 11025.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 11025.0 Hz, 16-bit, Mono, LittleEndian, Signed
    LINEAR, 8000.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    LINEAR, 8000.0 Hz, 16-bit, Mono, LittleEndian, Signed
    Now my system actually has 2 michrophones attatched to it. At the moment I'm using DirectSoundCapture to record audio. My first question is, how do you detect multiple audio capture devices? and then of course, how can you record off of different audio capture devices?
    Anything would be helpful, if theres a tutorial somewhere on this which i've missed somehow, please tell me. I'm probably missing something pretty major I figure.

    I posted in a different thread that I was using the old javax.sound.sampled library to try to record. However, using this library it was quite simple to get a list of devices which could then be used to make a SourceDataLine that could be used to record. However, I was having trouble actually recording and switched to JMF as it has more features and I thought it would be simpler to use. It probably is but I have been struggling. I can record audio in JMF fine but I cant get a device list as I could with the javax.sound.sampled library.
    I'll put the code I was working off in here anyway. It shows what I want to do, I just want to do it in JMF.
    Note that this code was written 4 years ago by a Matthias Pfisterer and not by myself.
    import javax.sound.sampled.AudioFileFormat;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.DataLine;
    import javax.sound.sampled.Line;
    import javax.sound.sampled.LineUnavailableException;
    import javax.sound.sampled.Mixer;
    import javax.sound.sampled.SourceDataLine;
    import javax.sound.sampled.TargetDataLine;
         /** List Mixers.
              Only Mixers that support either TargetDataLines or SourceDataLines
              are listed, depending on the value of bPlayback.
         public static void listMixersAndExit(boolean bPlayback)
              out("Available Mixers:");
              Mixer.Info[]     aInfos = AudioSystem.getMixerInfo();
              for (int i = 0; i < aInfos.length; i++)
                   Mixer mixer = AudioSystem.getMixer(aInfos);
                   Line.Info lineInfo = new Line.Info(bPlayback ?
                                            SourceDataLine.class :
                                            TargetDataLine.class);
                   if (mixer.isLineSupported(lineInfo))
                        out(aInfos[i].getName());
              if (aInfos.length == 0)
                   out("[No mixers available]");
              System.exit(0);
    Calling this method on my system will print the following.
    Available Mixers:
    Microsoft Sound Mapper
    AK5370
    SoundMAX Digital Audio
    AK5370 (2)
    This looks very different to what I get when I call CaptureDeviceManager.getDeviceList()
    How can I achieve the equivilent in JMF?

  • Error message trying to synchronise audio and midi sample rate 42463

    I have a Rode Podcaster mic that is terrific. It has been working fine in GB. suddenly I am getting this when I try to record my podcast:
    'Error message trying to synchronise audio and midi sample rate 42463 recognised. Check conflict between Garageband and external device'
    Has anyone experienced this before? How do I resolve it? I'm still using my Version 6.0.5.
    Apple, is this a way of forcing me to upgrade to V10?

    Just click the icon on each track that stops it acting as a live input. It looks like a sound wave. Only have them clicked orange when using the track to record! I don't know if that will solve your problem!

  • Error while trying to sync audio and MIDI, sample rate 39100 recognised??

    When I press record a message appears saying 'error while trying to syncronise audio and MIDI, sample rate 39100 recognised. Check conflict between garage band and external device. I'm using a Behringer UMC-202 interface. The inputs are selected as the device but no audio is present either.

    Just click the icon on each track that stops it acting as a live input. It looks like a sound wave. Only have them clicked orange when using the track to record! I don't know if that will solve your problem!

  • How to edit audio contents? (sample editing)

    Hi, I have a problem in editing a recorded audio. Can anyone please help me with this one? The scenario is this...
    I get my audio data by reading right from the line using targetdataline read method. Then I store the data in byte arrays. I tried to edit the values of each byte (in the byte array) by converting it to its short value, then alter its value before storing the new value to the source byte address.. Am I doing the right thing in the conversion and editing process?
    My audio configuration is this:
    audio format = PCM_SIGNED
    sample rate = 8000
    sample size in bits = 8
    channels = mono
    big endian = false
    Well, I use this for my cryptographic process in a simple VOIP program. I was having a hard time getting the valid values of the recorded audio stored in the byte array. Can anyone enlighten me with this matter?

    I have a "Recorder Class" that simply gets the audio data from the line. Here's some part of my code on how I get my audio data.
    synchronized public void run() {
            while( !m_bQuitting ) { //m_bquitting is a bolean variable which tells if the recording thread must be stopped
                 byte bs[] = new byte[bytesize];
                    m_line.read( bs , 0 , bytesize );
                 if( m_bRecording ) {
                        byte[] audio = new byte[bs.length];
                        //loop that initializes the temporary byte array to be encrypted
                                    //this simple copies the contents of bs to audio byte array
                        for( int i = 0; i < audio.length && i < bs.length; i++ ){
                             audio[i] = bs;
                        if(rsa != null) {
                             /*encryption*/
                             for(int offset=0; offset < audio.length && offset < bs.length; offset++) {
                                  short sample = (short)(audio[offset] & 0xff); //convert byte to short
                                  short tmp = rsa.code(sample);
                                  audio[offset] = (byte)tmp;
                             /*end of encryption*/
              cs.writebyte( audio );
         }else if( onlyonce ){
              cs.writebyte( ("NT|").getBytes() );
              onlyonce = false;     
    m_line.stop();
    m_line.close();     
    My simple VOIP works well without the encryption process. My real problem here is how can I open/edit the data that is stored in the byte array. Simple conversion of each byte to its short value doesn't seem to solve my problem. My RSA works well on data structures integer, string, double, float, hex, biginteger and etc. I have read some articles that says that audio samples are stored depending on the size of the sample bits used, and in my case its 8 bits (-128 to 127). My perception here is that if each sample is stored in a byte, then there would be a corresponding hexadecimal value for that byte. Am I right?(Can anyone enlighten me with this one???) My plan here is to encrypt and decrypt the audio data byte per byte so I need to get the audio sample data of a recorded audio.
    PS:
    Sorry for my first post. :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • No audio capture device detected Osprey 240e

    I have recently installed Adobe Flash Media Encoder (AFME).  I have installed the Osprey 240e video/audio capture card.  At first, the Osprey 240e was detected by the AFME.  Now AFME is telling me there is no audio device detected.  The video part seems to be fine.
    I have:
    1. Rebooted the computer AFME is installed on
    2. Reinstalled AFME
    3. Reinstalled the Osprey 240e drivers (reboot computer again).
    When I start the AFME program, it still indicates not audio capture device detected.  Any ideas on how to resover the issue.

    You may need to open a support case with Viewcast. They have always been very responsive when I have had problems/questions.

  • How to change audio port output to input port on mac os x 10.9.2 to connect electric guitar on macbook pro for garageband

    How to change audio port from output to input port so that i can connect my electric guitar to play along with garageband. I couldn't the option to change it in my system preferences of sound as my mac os x is 10.9.2. So please help me!!!!!!!!!!!! I want to play electric guitar with my garageband so badly!!! :O
    Mac os x 10.9.2. ; Garageband 10.0.2

    There is no audio line input on your Mac, get a USB interface, get one that is specified for guitars.

  • Media Encoder not finding "audio capture device"

    Hi,
    Im using Adobe Flash Media Encoder with Dxtory for Twitch streaming, and at first it worked fine. Recorded both my mic and game audio perfectly. Then seemingly suddenly, I fired it up  and it wouldn't stream the game audio. It would my Mic, but thats it. I then unplugged the mic and it started saying I had no Audio Capture Device. I checked in Dxtory and its set up the same as it was when it was working. It picks up both the mic and speakers like it should. I have uninstalled this program multiple times, both 3.1 and 3.2 versions, and each time when I re-download it, it loads up the same profile I had before. So when I am uninstalling it, its not uninstalling everything for some reason. Even though the program is no where to be found after its uninstalled. I have downloaded xsplit, and it picks up the game audio and my mic. So its just this program. Anyone have any ideas? I cant seem to find anything online about this issue.
    Thanks!

    From where?  PP sequence?  PP bin?  PP Source Monitor?  Watch folder?

  • [SOLVED] Setting default audio capture device

    I have a USB webcam with a microphone that is recognized by ALSA after the on-board line-in. This is fine in Skype because I can set the capture device to the USB microphone, but Flash seems to only use the first capture device (listing only "Linux Microphone") recognized by ALSA. Is there any way to set the default (presumably, the first) audio capture device, or get Flash to see my USB microhone?
    Last edited by matkam (2010-09-10 22:01:53)

    Solved by creating ~/.asoundrc file containing the following:
    pcm.usb
    type hw
    card U0x46d0x81d
    pcm.!default
    type asym
    playback.pcm
    type plug
    slave.pcm "dmix"
    capture.pcm
    type plug
    slave.pcm "usb"

  • Audio and visual sample rates

    hello
    everytime i capture using FCE it comes up with the warning that my rates do not match and says 'make sure the audio sample rate of your capture preset matches the sample rate of your tape'.
    when i ignore this warning, the visual and audio often match nonetheless. then at times they do not, and there is a definite lag.
    i posted a question about this before and the reply was to change the settings in Easy Setup to DV-NTSC. however, this did not work. i bought my camera in the uk (it is a sony DCR PC330E PAL) and so can't really see why ntsc would work.
    im sure this is a simple problem, but i am too inept to solve it! can anyone offer any help?
    thanks in advance

    Hi(Bonjour)!
    It's important to match video and audio format between your sequence(project) and your shooted material(camcorder settings).
    If you camera support PAL or NTSC, select the correct video format in easy setup dialog. That's the video format.
    Check your camera settings for audio format: there are 2 options 12 or 16 bit (in standard DV). It's preferable to use 16 bit with FCE.
    Select the correct audio format in easy setup dialog: if your shooted in 12 bit, select 32 kHz in easy setup. If you shooted in 16 bit, select 48 Khz in easy setup. That's the audio format
    Michel Boissonneault

  • The whole audio sync/weird sample rate/drift issue (FCP6)

    I can tell this question is doomed to fail on account of viewing the other unanswered questions on the subject in the forums, but I'll try nonetheless!
    So yeah, importing longer DV clips....audio rate winds up being 'weird' (as in 48003.9kHz instead of 48). Any way of straightening that out that doesn't require a buncha hoops? I've already tried re-exporting it from QT at 48kHz and a few other things. Do I just have to capture in separate chunks instead of one big go?
    I found a doc that says, "In previous versions of Final Cut Pro, the "Sync Adjust Movies Over [n] Minutes" option could be enabled in the preferences, triggering an adjustment in the audio sample rate based on the amount of audio recorded to disk during capture. In Final Cut Pro 4 [and up, I'm guessing] this preference has been replaced by automatic audio rate analysis, specific to DV media..."
    Apparently this rate analysis ain't working as well as it should...or something...
    Anyone?
    Thanks,
    E

    If your footage was shot with the Panasonic dvx100 camera, there is a known audio sync issue. You can install a patch from disc 1 of the FCP install discs inside of the "extras" folder. I've had this problem from time to time and I capture DVCPRO 50, so it's not just a mini DV issue. I usually get an audio rate slightly below 48, like 47.89999 or so. Are you using capture now? I used to get this problem a lot more when using capture now as opposed to log and capture. My solution has always been to always use log and capture and keep clips 15 minutes or shorter. I've tried trashing prefs and all that jazz, swapping out hard drives, but log and capture and shorter clip lengths always seem to clear it up.

  • Audio Midi Setup Sample Rate not Saving

    Hi Folks,
    I have Propellerhead Reason, Logic Express 8 and Line 6 gearbox running on my Macbook Pro, but every time I access the Audio/Midi Setup and change the sample rate to 48kHz, it reverts back to 44.1kHz whenever I restart my computer. It's absolutely driving me up the wall as none of my audio works (even in iTunes) until I reset it back to 48kHz. I've set all of my preferences in each of the apps to 48kHz, so I really don't understand why it's not saving in the A/M Setup. Oh, I have also tried deleting the library script for A/M Setup to let it generate a new one, but still no improvement.
    Please can someone help?
    Best,
    Deac. 

    Mouse was attached to the wrong port.
    When I removed the usb mouse cable from the computer and attached it to the keyboard port then attached the iMic cable directly to the computer--my Input suddenly made an appearance. *dances to the music*
    Problem solved.

  • "Audio Capture Device not selected" message?  Help please!

    Howdy folks,
    I just got a new PC, Windows 7 OS, I've installed ManyCam and version 3.2 of FME and am looking to broadcast again.  I don't recall this issue with my old PC (XP OS, Broadcaster StudioPro virtual cam and FME 2.5).  I updated to 3.2 as suggested/recommended in previous posts, but I am getting a message telling me to "please select audio capture devise connected to your system."  What am I doing wrong or might there be something that I need to download that I missed?
    Any help you can give is greatly appreciated.  I truly loved using FME 2.5 but am doing like you suggest here.
    Peace,

    Hello -
    My problem was fixed by setting a recording devise in my "sound" menu.
    What I did was -
    1.  Open the sound menu from the control panel.
    2.  clicked on the recording tab.
    3.  Chose "Stereo Mix - Realtek High Definition Audio" as my default device.
    That solved it.  It was almost too simple.    Hope this helps you!

  • Changing audio output device for currently running program

    I'm not sure where to put this question, but all my searching hasn't seemed to find an answer...
    If I have a program running, iTunes, VLC, a game, whatever, and want to change audio output from say Line Out to Headphones, I have to restart the program for the change to take effect. Is this by design/normal or am I missing something somewhere?

    this is actually a quiet significant issue. There is no way in Flash to select the audio output device.
    Today  people have regular speakers and a separate headset. They all use the  speakers for music and the headset for voice. Skype i.e. has the option  to choose audio output device and its really handy, because
    you dont  have to bother to set the default device to the headset everytime you  want to use it.
    If you set the default device to the headset all other apps will send their audio  output to the headset - which is not what you want either.
    So people  really want to leave the default device set to the speakers and not to  the headset.
    Nokia did this for Java
    JRT 2.1 / Nokia UI API updated to version 1.4:
                AudioOutputControl extension for controlling which audio output device, for example the device loudspeaker or earpiece, is used to play back audio
    This really is an issue.

Maybe you are looking for

  • How to use a Session object in a Javascript function

    I have an object that I have set in my session. On my jsp I want to pull it out of my session and use it as a parameter for a javascript function. But I am not sure how to do that... the function call is below... I want to assign a value to ifFormat

  • Advance payment Terms

    Hi All, Can anybody tell me how to configure a payment term as : 10% advance, balance within 60 days after goods receipt" ? I am not able to take care of the 'advance' part.

  • It doesn't work

    I'm using Red Hat 6.1 I tried everything in the installation guide I intalled jre116_v5 I set my Display I run the runInstaller under GNOME,KDE,Afterstep It allways give me Error in CreateOUIProcess (): -1 Bad adress Can someone please explain me ste

  • How to download LiveCycle Designer for frontend

    Hi all, I'm totally new in Interactive forms. I know that the ADS is already installed, because there are some application that use the interactive forms. My problems deals with my frontend. I try to install Adobe LiveCycle Designer ES from Adobe sit

  • Posting a full years worth but only display current date

    i am wondering how i go about posting my rss feed for the whole year but only allow itunes to read the current date? i understand from research that it takes the most current date and uses that as the first. but if i wanted to display September's 06