How to get audio device information connected with MAC system?

I want to know the samplerate (the number of samples per second) supported by the device connected with the MAC system.
I am also pasting the code as below where I need that info.
// Using PCM 44.1 kHz, 16 bit signed,stereo.
          AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,  //     the audio encoding technique
          44100.0F,// sampleRate           the number of samples per second
          16,      // sampleSizeInBits the number of bits in each sample
          2,       // channels           the number of channels (1 for mono, 2 for stereo, and so on)
          4,       // frameSize           the number of bytes in each frame
          44100.0F,// frameRate          the number of frames per second
          false);  // bigEndian          indicates whether the data for a single sample is stored in big-endian byte order (<code>false</code> means little-endian)

Kanni wrote:
Can you sugget something in that area.That's not an issue that's specific to MAC, it'd be specific to any system with a limited number of supported capture formats.
I've handled this problem in the past by generating an array full of all of the AudioFormat objects I'd consider acceptable, and I just iterate through them until I can find a TargetDataline that supports it.
TargetDataLine tdl = null;
/* Write your own code to get an array of acceptable formats here */
AudioFormat formats[] = JavaSoundFormats.getFormatList();
for (AudioFormat format : formats) {
    DataLine.Info dlinfo = new DataLine.Info(TargetDataLine.class,
                                             format);
        if (AudioSystem.isLineSupported(dlinfo)) {
            try {
                audio_in_format = format;
                tdl = (TargetDataLine)AudioSystem.getLine(dlinfo);
                break;
            catch(LineUnavailableException e) {
                // No need to do anything
/* If we don't have a targetdataoutput object, give up */
if (tdl == null) {
    System.err.println("No TargetDataLines found!");
    System.exit(1);
}

Similar Messages

  • How to get kensington K9294 to connect with original iPad. Bluetooth is on.

    How to get Kensington K9294 to connect with original iPad. Bluetooth is on.

    Sorry, but what is a Kensington K9294? I can find no mention of that product ID on the web, not even on Kensington's site. Do you mean the K39294, the KeyFolio keyboard/case?
    Regards.

  • How to get the local lan connecting all the system names ?

    how to get the local lan connecting all the system names using java?
    any body know then send the coding or solution

    This question is asked and answered repeatedly. Search the forum.

  • How to get audio out of speaker with angry birds app?

    How do I get audio from the internal speaker for my angry birds app.? Only audio is through the head phone jack......

    Have you got notifications muted ? Only notifications (including games) get muted, so the iPod and Videos apps, and headphones, still get sound.
    Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad, or via the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085

  • How to get Xfinity WIFI to connect with Droid Razor

    Since my Droid web browsing ability became  basically non functional w/ in the past couple of weeks for no apparent reason, I decided to
    try to connect to home Xfinity WIFI.  I use the WPS PIN from my XFINITY router for many devices w/ no problem.  My droid displays my home WIFI  as "HOME6c6c secured w/ wpa/wpa2 (WPS Available).'  I enter my XFINITY WPS PIN, when prompted on my droid, but I receive an error message.  Is there a setting to change to WPS on the DROID?  Any help is appreciated.   Is there a known problem w/ XFINITY / VERIZON Droid compatibility?

    While I don't have the Razor, I use Comcast Xfinity and wifi to connect our Android and iPhones without an issue.
    When you go into settings for wifi, before selecting any specific connection, tap the settings, and there you should see some options for WPS settings. 
    For advanced settings, select Show advanced options (enabled when a check mark is present).
    Ensure additional settings (e.g. WPS, Proxy settings, IP Settings, etc.) are configured appropriately (if applicable) then selectSave.
    (Taken from : http://support.verizonwireless.com/support/devices/knowledge_base.html/49570 )
    Hope this helps.

  • How to get a good wifi connection with Verizon FIOS?

    Hello...
    We switched to Verizon FIOS about a month ago, and since then I've had spotty connecting problems with wifi. My iMac needs to be re-connected a few times per day, as does my son's Macbook. Also, we have four iPhones and we all have to wait for our phones to switch to wifi from Edge when we turn them on. With our old NetGear router we had no problems. Our PC's are okay too. Just the Apple stuff. We've already called Verizon and they had us change our frequency, but that didn't help. Before calling them again I'm wondering if anyone has any advice? It's very frustrating. My husband thinks the Verizon modem/router is cheap compared to NetGear. But we're stuck with it. I'm still hoping to become a Verizon FIOS fan.
    Any ideas?
    Thanks in advance, Deb

    Joe -- we do have our cordless phone on a shelf next to the desk that the modem/router are on. But we also had it there when we had Time Warner and NetGear, with no problems. So I'm not sure that's it. Also since the location of the modem/router is the same as before, I don't know why the location would be a problem for the Macs now. My son had wifi problems with his PC before we switched, but now he's fine. I obviously have no idea about the neighbor's phones, nor could do anything about those if they were a problem.
    We have noticed that our cordless phone has some problems that it didn't have before Verizon FIOS, but we haven't really dealt with that yet as our landline phone is really pretty pointless now that we all have iPhones.
    I guess it's the channels that my husband is changing then, because he said there are channels 1-11, and we've used 1 and 11, and now he's trying 10. So far I'm not noticing much difference on my iMac. I still have to re-connect to the internet every time I wake my iMac from sleep, or turn it on in the morning. I never used to have to do that. Same with my younger son and his Macbook. Also our iPhones aren't connected immediately when we turn them on. They used to be.
    The only thing I know about frequency is that our cordless phone is one or the other of the frequencies you mention, but I don't remember which one now.
    I think we were given a user guide for the modem/router, and my husband has been reading through it, but not finding anything about turning off the wireless part of the router only. Thanks anyway though for the link. I'll check it out to see if it's something different.
    Thanks, Deb

  • How I get started using voice input with mac mail?

    Just got a new Imac.  have had Apple computers for a long time.  Want to start using voice input with mail.  How do I get started?

    Apple's voice input options are the following:
    Dictation
    This allows you to speak a phrase and have the system enter it as text in any text field, be it a name and address form or a text editor like Pages or Word. The settings for this service are in the Dictation system preferences, and by default you activate it by pressing the Fn key twice in a row and then speak the desired phrase after you hear the bing sounds.
    Speakable Items
    This option allows you to somewhat control the Mac's interface elements by speaking key phrases to the system. This option is enabled in the Accessibility system preferences, and is at the bottom of the listed services. In here you can turn on the service and calibrate it to properly hear your voice, set a "listening key" (similar to the Fn key for Dictation), and then enable various command libraries.

  • How to get audio recordings back on my Mac?

    I accidentally deleted most of my audio recordings on the Mac.  But they're still on my iPhone.  When I sync my iPhone to my Mac they don't go back into iTunes but they remain on my iPhone.  Is there a way where I can get them back in my iTunes library?

    The sync is one way - computer to iphone.  The exception is itunes purchases: File>Devices>Transfer Purchases
    It has always been very basic to always maintain a backup cop of your computer.  Have you failed to do this?

  • HT1689 I just upgraded to iTunes 11 and now I get a "itunes cannot connect with this ........ Could not allocate a resource. Happens with both ipad and iPhone. Any thoughts on how to resolve this issue?

    I just upgraded to iTunes 11 and now I get a "itunes cannot connect with this ........ Could not allocate a resource. Happens with both ipad and iPhone. Any thoughts on how to resolve this issue?

    Same for me with Iphone 5 and IOS 7 on mac pro. Install ITunes 11.1 and after reboot nothing work. Work only with Mac Pro in safe mode.
    I have uninstalled Wi-fi-sync1.0 app from MacPro and Itunes sync well with iphone.

  • How do I get my iphone to connect with my PC via WiFi

    How do I get my iphone to connect with my PC via WiFi?

    I Believe you are trying to use personal hotspot so you can use your 3G/LTE on your pc.
    If that's the question, you'll need to turn on "Personal Hotspot" in settings (it's right below bluetooth), then go to your Mac/PC and connect to your iphone as you would with a normal wi-fi connection. You can change the random default password in the same menu where you have turned on "Personal Hotspot"

  • Update to kichat: FAQ 2 - How to get my router to work with iChat?

    kichat: FAQ 2 - How to get my router to work with iChat? December 2008 version 3
    (Note to Hosts. to be removed on acceptance. Please use this to replace http://discussions.apple.com/thread.jspa?threadID=121775 )
    Getting your router started with iChat.
    Appropriate for using iChatAV 2 upwards. Edits have been made for iChat 4
    Glossary for this FAQ
    Routers: Any configurable device that sits between your computer and the internet link you have. This includes Modems that Route as well as "routers"
    Routers seem to fall into two categories
    Those that work straight from the box. See Apple Article HT1787
    NOTE :This Article has not been updated in content since Jan 04 Only being changed to an Article from the Previous Doc listing
    Even then some list that they need tweaks.
    and those that do not.
    This post will deal with what you may need to look at.
    First off make sure your device is acting as a DHCP server. (if you are already on the internet you may not have to bother with this.)
    Check in the Tiger System Preferences > Network Preference Pane, in the "Built in Ethernet" option from the "Show" drop down list.
    In Leopard the Networks are listed on the left with icons. The Airport Option will need you to access the Advance Button for the Next bit.
    Make sure the TCP/IP tab is the 'front' one. You should be able to see Configure IPv4 and it most likely reads Using DCHP. Make a note of your IP address. It will start 10.xxx.xxx.xxx or 192.168.xxx.xxx (the 'x' s will stand for any number between 1 and 255). The range 172.16.xxx.xxx is also a possible value at this point. Rarely used, but it is part of the RFC for Address Allocation for Private Internets.
    Your router is most likely to be configurable from your browser. You will need to find the IP address to type into the browser from any Readme or PDF files that came on the install disk or visit the makers website and download a manual.
    The Port Forward.com site lists many devices and clicking on one will take you to a list of Applications. This iChat will open an page that will start by telling you the defaults to access the device
    Opening or Allowing ports. Several Methods not all devices have all of them.
    DMZ (Demilitarised Zone)
    This is a less secure setting that basically opens all ports and points the incoming data to your computer. (not helpful if you have more than one computer on your LAN). It can be considered as an extreme form of Port Forwarding
    Port Forwarding (also Virtual Server or Pin Holes)
    These settings are usually found in an Advanced setting.
    You may need to set an incoming IP address (Usually 0.0.0.0 to any outside server), a port that data will arrive on, the Inside computer's IP address (your computer) and the port it will deal with the data on and the protocol it will use.
    See this pic for an example of the description above.
    In this example shows that on some Port AND Protocols need to be listed.
    iChat uses TCP and UDP so some devices will need the ports listed one by one and some settings done twice, once for each protocol. The example above has a "Both" setting
    See Apple Article HT1507 Previously Doc 93208 for more information. This is the Tiger iChat 3 list. The same ports are needed for Leopard except for these changes
    My Note 2:
    On the first link Note 1 under tables in that link would be better if it read:
    " 1. All iChat AV traffic is UDP -
    except for ports 5190 and 5298, which need to be open for both TCP as well;
    and 5220, 5222, which need to be open for TCP only. "
    Note 2
    GoggleTalk needs port 5223 on TCP. Also note the Server name for iChat 3 set ups
    UPnP Universal Plug n Play.
    This is a simple Plug and Play type of setting. iChat can find it's own way through a router if the device has this capability.
    By Not doing Port Forwarding, Triggering or DMZ and enabling UPnP the application is allowed to control the modem and the ports that are open.
    They close after the application has finished with them on a timed basis.
    On some devices the number of "hops" (how far away the UPnP can be "seen") can be reduced from a default of 4)
    Trigger Ports
    Some devices offer a security measure that works by a first or trigger port receiving a data packet and then opening further ports when accepted.
    The first port for incoming Video or Audio invites is port 5678.
    Pre iChat 4
    When you click on the invite window the process moves in to port 5060 (so these will need to be opened by the trigger port) for negotiating the final group of ports from the group of 20 (16384-16403 These will need to open when the trigger says so as well). Therefore port 5678 triggers ports 5678, 5060, 16384-16403. All on UDP. Port 5190 neeeds to trigger port 5190 for both TCP and UDP.
    See this variation where only the ports listed above are completed.
    The other single ports need to be set one by one in addition. (5220,5222, 5223 5297, 5298, 5353)Replace
    iChat 4
    The port used in IChat 4 is port 16402 instead of port 5060. The group of 20 ports is reduced to 10 (16393-16402). This is because all the In and Out Audio and Video data is on one port. Other that than the settings are the same.
    At this time there is no Info on the ports the Screen Sharing in iChat 4 uses.
    Wireless
    Here you will have to read around but this Apple Article TA25949 Previously Doc 58514 might be a good starting place.
    Essentially whether you are wireless or Ethernet to your routing device makes very little difference to the way you do things.
    Your computer will get two IPs from a DHCP server if you are connected by both methods. (iChat does not like this)
    Multiple devices
    Make sure only one is acting as a DHCP server. Make sure wireless devices are bridged properly.
    Further Help
    I have found that this site (ADSLGuide) to be helpful.
    It is British based but I have linked you to the Apple Related Discussions Forum.
    Eliminating Problems on my Personal web pages.
    The ports and their function within iChat. (my personal Web pages again)
    This is not a step by step approach. You will have to read around the information about your device.
    Collected FAQs and Expansions: Index Page Based on FAQs here by EZ Jim and myself
    Also http://www.portforward.com/routers.htm for instructions with Pics on Port Forwarding and access info as mentioned earlier.
    Click on your device.
    Select iChat on the next page.
    Follow the info on the next.
    This site is godd for finding out the Default IP to use in a web browser and the default User ID and Passwords needed to do so.
    Gives you a chance to look at at pics to give clues to where some of these other things are.
    With thanks to Macmuse for comment on the Original (Aug 23rd 2004)
    and to EZ Jim for his work on iSights on my web pages.
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    9:51 PM Saturday; December 6, 2008

    kichat: FAQ 2 - How to get my router to work with iChat? December 2008 version 3
    (Note to Hosts. to be removed on acceptance. Please use this to replace http://discussions.apple.com/thread.jspa?threadID=121775 )
    Getting your router started with iChat.
    Appropriate for using iChatAV 2 upwards. Edits have been made for iChat 4
    Glossary for this FAQ
    Routers: Any configurable device that sits between your computer and the internet link you have. This includes Modems that Route as well as "routers"
    Routers seem to fall into two categories
    Those that work straight from the box. See Apple Article HT1787
    NOTE :This Article has not been updated in content since Jan 04 Only being changed to an Article from the Previous Doc listing
    Even then some list that they need tweaks.
    and those that do not.
    This post will deal with what you may need to look at.
    First off make sure your device is acting as a DHCP server. (if you are already on the internet you may not have to bother with this.)
    Check in the Tiger System Preferences > Network Preference Pane, in the "Built in Ethernet" option from the "Show" drop down list.
    In Leopard the Networks are listed on the left with icons. The Airport Option will need you to access the Advance Button for the Next bit.
    Make sure the TCP/IP tab is the 'front' one. You should be able to see Configure IPv4 and it most likely reads Using DCHP. Make a note of your IP address. It will start 10.xxx.xxx.xxx or 192.168.xxx.xxx (the 'x' s will stand for any number between 1 and 255). The range 172.16.xxx.xxx is also a possible value at this point. Rarely used, but it is part of the RFC for Address Allocation for Private Internets.
    Your router is most likely to be configurable from your browser. You will need to find the IP address to type into the browser from any Readme or PDF files that came on the install disk or visit the makers website and download a manual.
    The Port Forward.com site lists many devices and clicking on one will take you to a list of Applications. This iChat will open an page that will start by telling you the defaults to access the device
    Opening or Allowing ports. Several Methods not all devices have all of them.
    DMZ (Demilitarised Zone)
    This is a less secure setting that basically opens all ports and points the incoming data to your computer. (not helpful if you have more than one computer on your LAN). It can be considered as an extreme form of Port Forwarding
    Port Forwarding (also Virtual Server or Pin Holes)
    These settings are usually found in an Advanced setting.
    You may need to set an incoming IP address (Usually 0.0.0.0 to any outside server), a port that data will arrive on, the Inside computer's IP address (your computer) and the port it will deal with the data on and the protocol it will use.
    See this pic for an example of the description above.
    In this example shows that on some Port AND Protocols need to be listed.
    iChat uses TCP and UDP so some devices will need the ports listed one by one and some settings done twice, once for each protocol. The example above has a "Both" setting
    See Apple Article HT1507 Previously Doc 93208 for more information. This is the Tiger iChat 3 list. The same ports are needed for Leopard except for these changes
    My Note 2:
    On the first link Note 1 under tables in that link would be better if it read:
    " 1. All iChat AV traffic is UDP -
    except for ports 5190 and 5298, which need to be open for both TCP as well;
    and 5220, 5222, which need to be open for TCP only. "
    Note 2
    GoggleTalk needs port 5223 on TCP. Also note the Server name for iChat 3 set ups
    UPnP Universal Plug n Play.
    This is a simple Plug and Play type of setting. iChat can find it's own way through a router if the device has this capability.
    By Not doing Port Forwarding, Triggering or DMZ and enabling UPnP the application is allowed to control the modem and the ports that are open.
    They close after the application has finished with them on a timed basis.
    On some devices the number of "hops" (how far away the UPnP can be "seen") can be reduced from a default of 4)
    Trigger Ports
    Some devices offer a security measure that works by a first or trigger port receiving a data packet and then opening further ports when accepted.
    The first port for incoming Video or Audio invites is port 5678.
    Pre iChat 4
    When you click on the invite window the process moves in to port 5060 (so these will need to be opened by the trigger port) for negotiating the final group of ports from the group of 20 (16384-16403 These will need to open when the trigger says so as well). Therefore port 5678 triggers ports 5678, 5060, 16384-16403. All on UDP. Port 5190 neeeds to trigger port 5190 for both TCP and UDP.
    See this variation where only the ports listed above are completed.
    The other single ports need to be set one by one in addition. (5220,5222, 5223 5297, 5298, 5353)Replace
    iChat 4
    The port used in IChat 4 is port 16402 instead of port 5060. The group of 20 ports is reduced to 10 (16393-16402). This is because all the In and Out Audio and Video data is on one port. Other that than the settings are the same.
    At this time there is no Info on the ports the Screen Sharing in iChat 4 uses.
    Wireless
    Here you will have to read around but this Apple Article TA25949 Previously Doc 58514 might be a good starting place.
    Essentially whether you are wireless or Ethernet to your routing device makes very little difference to the way you do things.
    Your computer will get two IPs from a DHCP server if you are connected by both methods. (iChat does not like this)
    Multiple devices
    Make sure only one is acting as a DHCP server. Make sure wireless devices are bridged properly.
    Further Help
    I have found that this site (ADSLGuide) to be helpful.
    It is British based but I have linked you to the Apple Related Discussions Forum.
    Eliminating Problems on my Personal web pages.
    The ports and their function within iChat. (my personal Web pages again)
    This is not a step by step approach. You will have to read around the information about your device.
    Collected FAQs and Expansions: Index Page Based on FAQs here by EZ Jim and myself
    Also http://www.portforward.com/routers.htm for instructions with Pics on Port Forwarding and access info as mentioned earlier.
    Click on your device.
    Select iChat on the next page.
    Follow the info on the next.
    This site is godd for finding out the Default IP to use in a web browser and the default User ID and Passwords needed to do so.
    Gives you a chance to look at at pics to give clues to where some of these other things are.
    With thanks to Macmuse for comment on the Original (Aug 23rd 2004)
    and to EZ Jim for his work on iSights on my web pages.
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    9:51 PM Saturday; December 6, 2008

  • I can not get my Ipod to connect with my computer using a usb cord

    I can not get my Ipod to connect with my computer using my usb cord ?

    Hi starhalcomb,
    I'm sorry to hear you are having issues with your iPod touch. I also apologize, I'm a bit unclear on your exact configuration. If you are having issues with your iPod touch not being recognized in iTunes when you connect via USB, you may find the information and troubleshooting steps outlined in one of the following articles helpful:
    iPhone, iPad, or iPod not recognized in iTunes for Windows - Apple Support
    If you don't see your connected device in iTunes for Mac - Apple Support
    Regards,
    - Brenden

  • I tunes has stopped working in windows 7 and I don't know how to get the crash information that everyone else seems to get to know what the cause is....any help?  I have a toshiba windows 7 computer.

    I have a toshiba computer and it is windows 7, recently after I installed imatch everytime I open itunes I get the message 'i tunes has stopped working' and windows cannot find a solution and has to close.  There is no solution and I don't know how to get the crash information on my computer....can anyone help as I want to finish downloading all my songs to match to be available on my mac products.

    Re: That garbage is unreadable.
    If you really want help, stop messing with the fonts and post so that others can read and offer suggestions.
    Or better yet... try a search, I'm certain you'll find a solution to whatever issue you're experiencing.
    I have found that many times it is the things that make you most angry that push you to action. This was the case here. Thank you for causing me to get so angry that I found the answer myself.

  • HT4260 I have an AirPort Extreme and a linksys router. What is the best way to get 6-8 wired connections with ac speeds?

    I have an AirPort Extreme and a linksys router. What is the best way to get 6-8 wired connections with ac speeds?
    Appreciate your assistance.

    The answer depends on whether the AirPort Extreme is your main router....or...the Linksys device is your main router.
    In either case, the two devices must connect together using a wired Ethernet connection using CAT5e or CAT6 cabling.
    Any version of the AirPort Extreme produced within the last 5 years will have Gigabit Ethernet ports. In order to get the same speeds from the Linksys router, it will also need to be Gigabit Ethernet capable.
    If you need additional Ethernet ports, you will need to add a Gigabit Ethernet switch to either the AirPort Extreme or Linksys router.
    It is assumed that your other devices connecting to the AirPort Extreme and Linksys router will also have Gigabit Ethernet capability.
    Not sure why you mention "ac" speeds in your post. This relates to wireless connections, not wired.

  • How to get audio to an overhead projector from iPad

    Hello All. Has anyone figured out how to get audio from ipad to an overhead projector? I know I could mirror if I had HD, but I do not have HD at work.

    U could try using the headphone jack sound can be output through this using the appropiate cord to connect to your projector.

Maybe you are looking for

  • Best to pay off credit card all at once or slowly over time?

    My urrent FICO score is ~730.  I just received a bonus and I want to pay off my sole (CitiBank) credit card with a significant balance.  Should I pay it off all at once or would it be better to pay it off slowly over an extended period?

  • What are your top 3 favorite AIR Native Extensions? (any OS)

    What are your top 3 favorite AIR Native Extensions? OS is irrelevant.

  • App is there but won't work

    I recently purchased Things app and was working fine, until last night I ran the update and now it has stopped working. It is there but can't access it. I had wondered whether it was due to the fact that I haven't go the new operating system for the

  • Know the number of the row in a select

    Hi experts, I´m doing a select * ... such as: *      SELECT * *        FROM YPLM00 CLIENT SPECIFIED *        WHERE mandt = sy-mandt *        AND TIPOL = 'RS' *        AND PSPNR = yplm00_tree-pspnr *        AND TIPOP = yplm00_tree-tipop *        AND P

  • Cldc and midp

    hi.. am new in j2me.i am doing a project in j2me.Is it possible to retrieve data from a text file and bind in to choice or list box ?