Play sound from ByteArray

Ok, so I'm trying to record sound from a microphone, allow the user to preview the sound, then compress the sound to mp3, and upload the mp3 to the server.  I've gotten everything to work except for allowing the user to preview the sound.  The microphone records a raw byteArray, but the Sound class can only play a URL request.  I've type-casted the byteArray to a Sound class, I've compressed it to mp3 and type-casted it, but it doesn't work.  I can send it to the server, and then request the server and play it, but this isn't optimal.  Does anyone know how to play an uncompressed byteArray generated by the microphone? 

I think you want to use the sampleData event from the Sound object.

Similar Messages

  • Playing sound from multiple applications?

    Hi, I recently started using Arch and I'm loving it but I have one problem. My ALSA can only play sound from one application at a time, so I have to use pulseaudio for the others. But pulseaudio doesn't recognize my mic so I can't remove ALSA. ALSA just says "device busy" or something. And yes I tried to search before posting but didn't find an answer.
    Thanks

    This is what I found from the logs:
    Jul 18 21:38:34 arch pulseaudio[946]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
    Jul 18 21:38:34 arch pulseaudio[946]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
    Jul 18 21:38:34 arch pulseaudio[946]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
    Jul 19 00:53:54 arch pulseaudio[946]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 19 00:53:54 arch pulseaudio[946]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 19 21:59:22 arch pulseaudio[963]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
    Jul 19 21:59:22 arch pulseaudio[963]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
    Jul 19 21:59:22 arch pulseaudio[963]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
    Jul 20 02:35:47 arch pulseaudio[963]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 20 02:35:47 arch pulseaudio[963]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 20 12:22:05 arch pulseaudio[981]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 20 12:22:05 arch pulseaudio[981]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 20 12:22:05 arch pulseaudio[981]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 21 01:25:49 arch pulseaudio[953]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
    Jul 21 01:25:49 arch pulseaudio[953]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
    Jul 21 01:25:49 arch pulseaudio[953]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
    Jul 21 14:33:44 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 21 14:33:44 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 21 14:33:44 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 22 01:58:04 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 22 01:58:04 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 22 02:20:11 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 22 02:20:11 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 22 02:48:30 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 23 00:21:44 arch pulseaudio[973]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
    Jul 23 00:21:44 arch pulseaudio[973]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
    Jul 23 00:21:44 arch pulseaudio[973]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
    Jul 23 11:43:46 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 23 11:43:46 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 23 11:43:56 arch pulseaudio[973]: alsa-sink.c: Error opening PCM device front:0: Device or resource busy
    Jul 24 03:05:32 arch pulseaudio[954]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
    Jul 24 03:05:32 arch pulseaudio[954]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
    Jul 24 03:05:32 arch pulseaudio[954]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
    And yes I have gstreamer.
    Last edited by nerdster (2011-07-26 00:35:45)

  • My iPad (4th gen) will not play sound from videos played via Facebook. Anybody have suggestions?

    My iPad (4th gen) will not play sound from videos played via Facebook. Anybody have suggestions?
    I've restarted my iPad, there are no available updates that I am aware of.

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • How can I play sound from my MacBook Pro through my iMac?

    I have a MacBook pro which I am looking to use for only iTunes or Spotify for the time being but the iMac built in speakers are better.
    I am internet sharing from an ethernet on my iMac and the Macbook pro is connected to the shared network.
    Can I play music from Spotify on my macbook pro but out of my iMac speakers?
    Thanks
    James

    For sound, try the audio output port and connecting to the RCA  audio input ports on your Pioneer receiver.  Use something like this:
    http://eshop.macsales.com/item/OWC/PODCONNECTOR/
    Ciao.

  • Bluetooth Headset does not play sound from ipad touch 4th gen. ipod touch 4th gen. although it does pair ok! Please help!

    HM1200, BH99b, JabraBT2045 bluetooth headsets do not play music from ipad, ipod touch 4th generation, although it does pair ok. Why is that if it is compatable, why it does not play any music or sound via bluetooth headsets.  When I pair the headsets to Mac it does play music via bleutooth headsets!  Please help me!  Also, how to connect several or two bluetooth headsets to one device: Mac, or iPad iPod touch 4th generation? Please, reply as soon as possible!

    Your iPad has built-in WiFi. You cannot and don't need to use the USB dongle.
    Look in Settings > WiFi. Find the SSID of your wireless router, tap it's name and enter the WiFi password.

  • Playing sound from my macbook to my imac

    I'm using my iMac as an external display for my macbook pro. Since my iMac does not support thurderbolt, I've had to connect it using a Mini displayport. I've bought a 3.5mm Male to Male Stereo Cable so I could play the sound from my macbook through my iMac but both go silent. Anyone have any suggestion on how I could play sound on my macbook through my iMac?  Thanks in advance.

    Firstn make sure that the male audio cable is plugged into the "audio out" port on the MacBook and is plugged into the "audio in" port on the iMac. Second make sure you are in the MacBook system preferences (Not the iMac) then click headphones. The thing named "Headphones" is your iMac. I hope that helped

  • Play sound from my headphones

    Hello,
    Sometimes when I sit and talk to my friends I want to play something for them and instead of unplugging my headphones and plugging in my speakers to play the sound to them,
    I would like to know how I can play the sound from my headphones so my friends can hear it, how can I do that?

    Anyone? Would really like to know 

  • Airtunes will not play sound from youtube

    Hi, I have just bought Apple PC for myself. It Works flawlessly, except for one thing. I can play radio or podcasts, but I just can't seem to get trhe sound from youtube videos or movies to play through airtunes. The logic seems to be thatsounds from movies cannot be played through airtunes. It doesn't make sense, or does it?
    Any help is appreciated, P

    if you are trying to stream the youtube video from the Apple TV, it is as Brian says.
    if you are trying to stream it from your computer, see Meg's remarks.
    happy easter holidays, Y'all ...

  • IOS: (not) playing sound from local file system - Error #2032

    Dear all,
    I am working on an app where I want to (among others) play sound files from the local file system.
    I have added a few mp3 files into my .ipa file.
    With a small file browser in my app I can select any one of them which returns me a File object.
    I then use this File object to do a URLRequest to load the sound:
    var req:URLRequest = new URLRequest(file.nativePath);
    sound = new Sound();
    sound.addEventListener(IOErrorEvent.IO_ERROR, soundLoadError);
    sound.addEventListener(Event.COMPLETE, soundLoaded);
    sound.load(req);
    It works in flash, but fails on the iPAD. Everytime I try to load, I get a IOErrorEvent with error code Error #2032
    When I replace new URLRequest(file.nativePath) with URLRequest("http://.../testfile.mp3"), everything works fine!
    Any help appreciated.
    Is this a matter of Security settings? Can I change those?
    Something to do with Sandboxing (whatever that is)?
    or something to do with cross-domain access?
    I have been looking around for days now and any help would be appreciated!
    I am using Flash CS5.5 & AIR 2.7
    Thanks, Marcus.

    Hi Sanika,
    this was something closer to that paragraph for "nativePath":
    Some Flex APIs, such as the source property of the SWFLoader class, use a URL (the url property of a File object), not a native path (the nativePath property).
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml#nativePath
    but that is not exactly what I've read (maybe that was A-blog or post on someone from A-team on his personal blog or post on stackoverflow).
    (myself I'm using and providing solutions for paths using FILE protocol - file URI schemes - mostly whenever I can and where it is supported)
    regards,
    Peter

  • Playing sound from the mic input

    I'm running my turntable through a mixer and then running the line level signal into the mic input on my macbook. It sounds fine when I record the sound, but I can't seem to get it to play sound live.
    I used to do this on my pc by Muting and un-Muting the mic or line-in input, but on the macbook this doesn't seem to work.
    What am I doing wrong?

    I guess I should add that the mixer is showing normal volume levels and when I run Audacity, the volume levels are normal. I just want to convert my input from "recording only" to playback.

  • Cannot play sound from https link

    I'd like to ask why we cannot play integrated sound on a web page when the sound file (.wav format) is located with https url link. From the same web page, the sound can be played well with Internet Explorer.
    Thanks a lot for your support.

    Hi,
    Here is the javascript code we used for playing sound in background.<br />
    <br />
    <pre><nowiki> <script type="text/javascript">
    var DIV_beepSoundContainer = new div("beepSoundContainer","","");
    guiOMPage.addElement(DIV_beepSoundContainer);
    </script><div id="beepSoundContainer" class="" style="" onmouseover="" onmouseout="" onclick=""><object type="application/x-mplayer2" height="0" width="0"><param name="fileName" value="https://www.telephoniemobiles-standard.test.orange-business.com/console/standard/login/help/Btelm/beep1.wav"><param name="AutoStart" value="true"><param name="PlayCount" value="1"></object></div><script type="text/javascript">
    DIV_beepSoundContainer.init();
    </script></nowiki></pre>
    <br />
    Unfortenately, I could not give you the page web & use case where the sound should be played (authentication required). Again, the sound is played well with Internet Explorer.
    If I replace the link by http://..., the sound works well.
    Do you know any limitation of Mozilla related to the use of https?
    Thanks a lot for your help.
    Regards

  • Stolen Ipod plays sound from icloud but doesn't locate

    My Daughter's Ipod touch was stolen from her locker.  I have locked it on Icloud and also asked icloud to play  sound.  Well the one day I got an email stating it played the sound, and the location.  However, now I only get the sound played email.  I haven't gotten an email stating the location.  Why is that?  the ipod must connect to wifi to play the sound, but is it not on long enough to be located??

    For location the iPod uses the location of nearby wifi routers that are in Apple's database. Thus, it appears that the router that is not in Apple's database.

  • Probook 4530s (Win 7, 64-bit) - suddenly stopped playing sound from the internal speakers!

    Hi all,
    Recently I was watching youtube video on the laptop and the sound from speakers just gone! Just like someone disconnect the speakers, sound silly, I know
    I restarted the the laptop then, but speakers are still not giving any sound at all. I can only hear the sound coming through the connected headphones.  I checked all the drivers and everything seem to be fine. Here is a screen shoot from device manager:
    http://s27.postimg.org/t4q9r8toj/devicemgr.png
    I don't understand what is going on? Is anybody experienced this issue before? How to fix it? Thanks in advance

    Hello @Frankaffair 
    To get your issue more exposure I would suggest posting it in the commercial forums since the ProBook 4530s is a commercial product. You can do this here Notebook - HP ProBook, EliteBook, Compaq, Slate/Tablet PC, Armada, LTE
    The support page for your product may be helpful in the meantime: HP ProBook 4530s Base Model Notebook PC.
    I hope this helps!
    Thank you for posting on the HP Forums.
    Malygris1
    I work on behalf of HP
    Please click Accept as Solution if you feel my post solved your issue, it will help others find the solution.
    Click Kudos Thumbs Up on the right to say “Thanks” for helping!

  • How do you use the keyboard to play sound from a button?

    I am building a site for a client who wants to be able to
    press a keyboard button such as the "up" button and have it play an
    instrument sound. I am fimiliar with html and css coding but i am
    not that great at actionscript. It would be greatly appreciated if
    someone could show me what I would have to do to achieve this
    affect. I was looking around the web and saw something that said I
    might need an eventlistner. I am com,pletely lost! All help
    welcome. Thanks. Here is an example of exactly what I am trying to
    achieve, the only difference is it doesnt need to be complicated
    and I only need it to work for 3 buttons.
    http://www.ababasoft.com/music/drums01.htm
    http://www.kenbrashear.com/

    dasaimedia wrote:
    > I am building a site for a client who wants to be able
    to press a keyboard
    > button such as the "up" button and have it play an
    instrument sound. I am
    > fimiliar with html and css coding but i am not that
    great at actionscript. It
    > would be greatly appreciated if someone could show me
    what I would have to do
    > to achieve this affect. I was looking around the web and
    saw something that
    > said I might need an eventlistner. I am com,pletely
    lost! All help welcome.
    > Thanks. Here is an example of exactly what I am trying
    to achieve, the only
    > difference is it doesnt need to be complicated and I
    only need it to work for 3
    > buttons.
    http://www.ababasoft.com/music/drums01.htm
    >
    http://www.kenbrashear.com/
    Many ways to achieves that. You can make a movie clip with
    (for 4 sounds) 5 frames.
    Frame 1 stop(); to prevent it from running. Frame 2 attach
    your sound, frame 3 another
    sound, frame 4 and 5 same. Give that movie clip instance name
    "soundCLIP" Now all you
    need is to add key listener to timeline frame so you can
    capture the key and go to
    corresponding frame of the movie clip to play your sound.
    var keyListObj:Object = new Object();
    keyListObj.onKeyDown = function() {
    switch (Key.getCode()) {
    case Key.LEFT :
    soundCLIP.gotoAndStop(2);
    break;
    case Key.UP :
    soundCLIP.gotoAndStop(3);
    break;
    case Key.RIGHT :
    soundCLIP.gotoAndStop(4);
    break;
    case Key.DOWN :
    soundCLIP.gotoAndStop(5);
    break;
    Key.addListener(keyListObj);
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Can't play sound from multiple programs

    So I have this new shiny box running Arch64 with a ASRock N68-S motherboard. I installed alsa and I am able to play music just fine using amarok or mpd. However, when I try playing two sounds at once, there is a short pause and the first program becomes silent, and then the second kicks in.
    According to the wiki, dmix should work automatically with this version of alsa. I tried seting up dmix "the old way" using /etc/asound.conf (hey, you never know) but no luck either.
    Lspci lists my card as
    00:05.0 Audio device: nVidia Corporation MCP61 High Definition Audio (rev a2)
    I figured this was a bit vague and went to the manufacturer's site and found out the actual name is
    5.1 CH Windows® Vista™ Premium Level HD Audio (Realtek ALC662 / VIA® VT1708S / VT1705 Audio Codec)
    The Alsa wiki suggests to test dmix using these instructions but this simple test fails miserably, alsaplayer windows show up and complain "no stream found". So it seems and one of the unlucky few for which dmix doesn't just work.
    However, OSS4 works with hardly no setup. But I just don't want to use it since most applications aren't OSS-aware, there is no KDE integration and so on.
    What sould I do? I'd happy to report a bug upstream if necessary but I realised audio in Linux is way more complicated than previously thought and I'd rather make sure I haven't over looked something. I'm so confused I can't tell what my actual soundcard vendor is: nVidia, Realtek or Via?
    edit: oh and of course, nothing of interest in /var/log/everything.log
    Thanks!
    Last edited by eldalion (2010-02-21 17:28:53)

    eldalion wrote:I tried seting up dmix "the old way" using /etc/asound.conf (hey, you never know) but no luck either.
    Not necessary. ALSA supports dmix by default. Don't edit that file.
    Let me explain what's happening. mpd has a stupid default config, of using OSS rather than ALSA. And OSS screws up dmix.
    For example, my ~/.mpdconf is:
    music_directory "~/gnutella/downloads/Cool"
    playlist_directory "~/.mpd/playlists"
    db_file "~/.mpd/mpd.db"
    log_file "~/.mpd/mpd.log"
    error_file "~/.mpd/mpd.error"
    audio_output {
    type "alsa"
    name "Sound Card"
    options "dev=dmixer"
    device "plug:dmix"
    Try that, to prove to yourself that I'm right   Also use this good debugging command, from the same ALSA wiki entry (because I put it there):
    fuser -v /dev/snd/* /dev/dsp*
    eldalion wrote:What should I do?
    Step 1: File a bug with your distro, for the app (mpd) to default to ALSA instead of OSS. Defaulting to OSS these days is ridiculous - ALSA is the standard sound system in Linux, and that's not gonna change.
    Please do this. I'm not doing this, because I don't use Arch or mpd any more.
    Step 2: File a bug upstream, to default to ALSA instead of OSS.
    Edit: I notice that Ubuntu has the right idea:
    * Update mpd.conf from upstream
        - Configure an ALSA output by default
    Last edited by brebs (2010-02-23 07:56:16)

Maybe you are looking for

  • Strange problem with auto-fill addresses in mail and address book

    There's an entry in my address book (version 4.0.6) that keeps adding a first name to an entry. I keep deleting it and somehow the first name keeps getting added. I suspected that Mail (2.1.3) was using auto-fill or LDAP to take the name it remembere

  • Does globals.jsa exist in JDeveloper 10.1.3.3.0

    Hi Guys, I've built some old jsps using JDeveloper 10.1.2.1.0 (Build 1913) and want to bring them across using the JDeveloper 10.1.3.3.0. Because 'globals.jsa' was automatically generated by the JDeveloper 10.1.2.1.0 and when I tried to migrate the p

  • 5800 Charging problem?

    Hi everyone, I recieved my 5800 on Tuesday, I charged it up fine then, but the next day it needed charging again and the phone wouldn't recognise I had put the charger in... I left it and phoned the company I got it from and they have sent a new char

  • HR- FI issue

    Hi Everyone I need a help in FI issue The probelm is that "Error while posting balance field , balance field profit centre line item 001 not filled ( while posting to accounting) History of the problem : SAP Standard varient : with the sap standard v

  • Log-in message - Network Services Unavailable

    I have been getting the following message upon both my G5 - 10.5.8 and my iMac - 10.6.1 prior to logging in after booting up both machines , both of which are the only two machines upon the same Airport Extreme network. *Network Services Unavailable*