Aac audio doesn't seem to work in AIR at all

I was looking at sample code from David Hassoun about how to play AAC sound files in Flash. His code in Flash works great. But the same code more or less, moved to an AIR Desktop project, fails completely, without any error message. A baffling situation. I am just trying to play a simple sound file, a trivial operation. I know the sound file exists, and can be found but nothing comes out of the speaker, and no messages from the stream system occur either.
Is this possibly due to an obsolete runtime of my AIR system? how does one locate the AIR version you are running? There are so many AIR runtimes sprinkled through my hard drive...
<pre>
  public class SysSound extends Object
  public static const TRACE_SOUND : Boolean = true;
  public static var g_connection :NetConnection;
  public static var g_stream :NetStream;
  //================================
  //    on_metadata
  //================================
  //  streaming video needs this kind of function
  //  callback function for meta data handling
  private static function on_metadata( info:Object ):void
  if (TRACE_SOUND) trace ("onMetaData was called!");
  //================================
  //    play_external_aac
  //================================
  //  play an external file (must specify the folder!)
  //  should be in m4a format
  public static function play_external_aac (path : String) : void {
  var fd :File;
  fd = File.applicationDirectory;
  fd = fd.resolvePath(path); // audio/xxxx.m4a");
  if (TRACE_SOUND) trace ("about to play "+path+", exists="+fd.exists);
  if (!fd.exists)
  throw new ArgumentError ("can't find external sound "+path);
  var customClient : Object = new Object();
  customClient.onMetaData   = on_metadata;
  var nc:NetConnection = new NetConnection();
  nc.connect(null);
  var my_stream:NetStream = new NetStream(nc);
  my_stream.client = customClient;
  my_stream.play(fd.url)
  //  to stop the sound call channel.stop()
  } // end func
  </pre>

the problem with this code is a classic Actionscript programming error; the object my_stream is allocated on the stack, and when the function returns it disappears. The reason Flash works, is that the code on Frame 1 is never deallocated, but in AIR, you gotta make the my_stream variable static otherwise it is deallocated before it even gets a chance to start playing. Sure wish adobe would catch this kind of error in the runtime or at the compiler level. What is very difficult to judge is which variables have to be declared as static?  the customClient object is added as a reference to my_stream.client, so as long as my_stream is around, that object is marked as "used" by the garbage collector.... this whole issue of when to mark something as static vs. can be assumed dynamic is awfully frustrating.

Similar Messages

  • Forum search doesn't seem to work for Date Range 'ALL'

    Hi there,
    Forum search doesn't seem to work for Date Range option: 'ALL' .
    For a given search criteria, I get few search results when the date range is chosen as 'last year', but for the same search criteria, when the date range is chosen as ALL, no search results are shown (not even the ones shown earlier for last year selection).
    regards,
    AJ

    Can you please delete my few duplicate replies in [CJ20n|Re: Long Text at Activity Level in CJ20N] thread?:-)
    Cheers,
    Amit.

  • Noise reduction (audio) doesn't seem to work - what am I missing?

    Hi,
    In a clip that I'd really like to use, there is a pervasive buzzing hum throughout, especially noticeable in long shots where there isn't any competing or overriding sound.
    I've read the instructions in the manual for taking and saving a noise print of the noise itself (there is a perfect segment in the clip to use for this), and for applying it to the entire clip by Selecting All and going to Process>Noise Reduction>Reduce Noise, then applying the saved Preset.  Also watched the video, which gave exactly the same directions.  The Noise Reduction line appears in the Actions tab underneath the clip name, and it looks like it's processed, but when I bring the HUD up and hit the Play button, nothing has been removed.  The offending sound is still there.
    If I click on the Noise Only box in the HUD, there is no sound at all, which seems to indicate that Noise Reduction hasn't actually been applied.
    I've deleted the file from Finder and started from scratch twice, but still can't get it to work.
    Obviously the Noise Reduction can't just "not work" - so as a new user of Soundtrack (3.0.1), what have I not understood?
    Thanks,
    Marg

    When you get to Process > Noise Reduction > Reduce Noise, usually a preset isn't the answer, but some manual fiddling. 
    Here's the way I approach this:
    1. When I set the noise print, I play/loop the clip and note the level of the noise in your meters. When I get to the threshold in the noise reduction window, that level will be the extreme highest threshold I use, only going lower from there.
    2. When it comes to the reduction, I check the Noise only box while I'm setting it, and boost the reduction until I'm getting noise, but not too much signal I want to preserve. If I hear voice in there, I'm doing too much. And I rarely end up going beyond 60%.
    3. Uncheck the noise only box, and listen to the signal with noise reduced to fine tune further.
    Remember this is noise reduction, not noise elimination. And, the STP tool is pretty good for what it is, but it's not anywhere near the best out there.
    Good luck, and I hope this helps!
    Matt

  • Recording audio doesn't seem to work

    I can't get GarageBand to record any audio. When I try, all it takes in is a lot of static. I tried plugging in a an external USB microphone, but that didn't work, either. I didn't have this problem until yesterday (both with the internal and external microphones). The speech recognition works fine, though.

    Garageband occasionally refuses to recognize my iMic as well. I do this to get it to work:
    <ol="number">
    Connect the device with GB closed.
    Open GB.
    In GB's audio preferences choose your device from the pull down menu. GB initializes the driver.
    Quit Garageband and open it again.
    Kurt

  • I'm unable to sync my ical with my ipad. I've tried to set it up through i-tunes but that doesn't seem to work.

    I'm unable to sync my ical with my ipad. I've tried to set it up through i-tunes but that doesn't seem to work.

    You have sync all iCal calendars chosen or selected calendars?
    No problems syncing contacts with the Address Book or with anything else included with the iTunes sync process?

  • Wacom Tablet doesn't seem to work all of the time?

    I have a Wacom Intuos 3 tablet, not more than a year old. I recently installed it onto my Macbook Pro and it worked fine, but when I unplugged it and came back to work with it later, it doesn't seem to work. The mouse doesn't respond to where I click on the pad.
    So, I've reinstalled this a couple of times and was able to make it work perfectly, but today when I went back to work in photoshop, it doesn't seem to be responding again.
    Does anyone have any tips? I know that Leopard likes you to eject USB devices instead of just pulling them out of the slot, but I don't see anywhere to eject it.
    Does anyone know what's up?

    Downloaded a driver from website, tablet works now.

  • Safari on my iPhone 6 running 8.02 doesn't seem to work right. Some Java scripts don't show correctly and they do on other browsers I have downloaded. I tried almost everything and nothing seems to work to fix it. Please help.

    Some websites like the one of my college uses JavaScripts and they seem to load correctly to a certain point but then not really. For example in one it would say select an option from the left menu. And I do it hut nothing happens. But when I go to the same website in another browser on my phone. The JavaScript works completely and allows me to see whatever I was clickig on that menu. I have seen that there are other websites being affected too. I tried clearing my cookies and data. even restarted my phone. And doesn't seem to work. I don't know how change the configuration any more to make it work like normal. At first I thought it was my school's website but it never got fixed. And now I realized is my safari browser! I wanna keep using it since I am really familiar with It. If someone knows how to fix this please let me know!
    Thanks

    You can reset the SMC and see if that helps. If it's a unibody or Retina, follow the method for "a battery you should not remove yourself."
    http://support.apple.com/kb/ht3964

  • I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?

    I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?    

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • I'm travelling and trying to back up my new iPhone to iCloud. I have sufficient storage, am connected to wifi and it's plugged into a power source and yet it doesn't seem to work. Can anyone suggest what I'm doing wrong?

    I'm travelling and trying to back up my new iPhone to iCloud. I have sufficient storage, am connected to wifi and it's plugged into a power source and yet it doesn't seem to work at all. I'm currently in India. Could that be the cause or can anyone suggest any reason why this wouldn't work?

    "gets stuck" - are there any error messages?
    If you get the error "Backup not successful" and you've tried deleting the last backup and trying to back up manually without luck, try the following test:   Go to...
    Settings>iCloud>Storage & Backup>manage Storage, tap your device name in the Backups section, then look under Backup options.  Turn off all apps from backup and then do a manual backup.  If that doesn't work, then this post will not help.  If the backup works, then go back to the app list and turn some on and try another backup.  If successful, keep repeating these steps.  If it fails at some point, then try to zero in on the one app that seems to make the backup fail.  (I had this problem and found one app failing, probably due to a corrupt data file.)
    This process will take time, but if a backup works with no app data being used but clearly fails with the original settings, then somewhere in the mix of apps is a "bad" one.

  • Pdfmark code in MS Word 2008 doc doesn't seem to work properly to create Named Destination

    Hi all,
    I've been having trouble with creating Preview-compatible Named Destinations in Acrobat 9.x (see http://forums.adobe.com/thread/770470?tstart=0).  Distiller, on the other hand, appears to create compatible Destinations, so as a last-ditch effort, I tried to go back to my original source file (Microsoft Word 2008 document) to use Distiller's pdfmark functionality, to see if maybe I could finally get a PDF with Preview-compatible Destinations.
    Following instructions found elsewhere on this forum, I went into Word and inserted the following field into a test location in my document:
    PRINT "[ /Dest /testdest /View [ /XYZ null null null ] /DEST pdfmark"
    This field code is supposed to then cause a pdfmark to be inserted into the resulting PostScript and/or PDF files.  Distiller is supposed to understand this and turn it into a Named Destination called "testdest."  However, it doesn't seem to work - I don't see the pdfmark code in the PS file, and the PDF file doesn't have any Named Destinations in it.
    I'm using Acrobat 9.x on Mac OS X 10.6.5, so I tried this two different ways:
    1) Using the "Print to Adobe PDF" workflow (which replaced the "Adobe PDF Printer" from previous OS/Acrobat versions) - this automatically generates a PDF via (presumably) an API call to Distiller... and
    2) Using the "Print to Postscript" workflow to generate a PS file, which I then ran through Adobe Distiller.
    In neither case did I end up with a named destination in the PDF file, as I was supposed to.  In case #2, even the Postscript file didn't have a pdfmark embedded in it.  Thus, I'm assuming that perhaps this is particular issue may be a problem with MS Word 2008 rather than with Acrobat... but I'm hoping someone might have a clue as to how to fix it.
    I welcome ideas on how to get Word 2008 to properly output pdfmark code, so that Distiller will pick it up and properly embed a Named Destination into the PDF...
    Thanks in advance.
    (If anyone has ideas about the Preview-compatible problem, linked above, that would also be great!)

    You're suggesting that it was never fixed from Word 2004 to 2008?  Possibly.  I wonder if it's fixed in Word 2011?  Anyone know?  But is it really a Word problem, rather than a Distiller issue?
    I appreciate your offer, though I do have access to Word on Windows (2003, I think), so I could try Distilling there... I only worry about formatting, since there are minor differences (e.g. font kerning, etc.) between Mac and Windows that are subtle, but sufficient to create formatting issues for very long documents (e.g. pushing figures onto the wrong pages, etc.).  That would be a rather big problem.
    The question remains whether this is an issue with Word or Distiller, though... and whether it's fixed in Distiller X and/or Word 2011.
    Adobe, care to comment?
    I'd really love to find a proper Mac solution, if one exists... it would be rather a slap to Mac users if a solution doesn't exist.

  • Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts.    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly i

    Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts. 
    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly in this view.
    It's always the second search that is problematic.
    I've tried typing over and all it seems to do is confine the search to the the entries that have come up for the previous search.
    I've tried to use the x to clear the previous entry and then type the next search, same problem.  The only way seems to be to move from "All Contacts" to "Groups".  Then the searched name appears and I can return to All Contacts to see full details.
    Surely three key press' are not the way it's supposed to work?
    FYI
    Processor  2.7 GHz Intel Core i7
    Memory  8 GB 1333 MHz DDR3
    Graphics  Intel HD Graphics 3000 512 MB
    Software  Mac OS X Lion 10.7.3 (11D50d)
    Address book Version 6.1 (1083)
    MacBook Pro, Mac OS X (10.7.1), 8Mb RAM 2.7Ghz i7

    AddressBook experts are here:
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion#/?tagSet=1386

  • I have Adobe Design Standard CS6 purchased 2013 with serial number but cannot find to download it onto a new mac laptop. When I try and add the 24-digit serial number to my account it doesn't seem to work?

    I have Adobe Design Standard CS6 purchased 2013 with serial number but cannot find to download it onto a new mac laptop. When I try and add the 24-digit serial number to my account it doesn't seem to work?

    CS6 - http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html
    You can also download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • TS5183 My Iphone has a problem with the microphone it doesn't seem to work! so there for i can't use Siri anymore..:-( this has been playing up for some time now.

    My Iphone has a problem with the microphone it doesn't seem to work! so there for i can't use Siri anymore.. this has been playing up for some time now. But as my wife & I had a baby 7 Months ago I have not found the time to pop in to the apple store until today (8/12/13) and they told me that they couldn't help as it's out of it's warranty by 57 days
    Can antone help me? is there something i can do, apart from buying a new iphone!

    Have you got Siri turned on in settings/general/restrictions?

  • My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    Thank you both for your responses but my daughter was reassured by the salesman in the iStyle store (official Apple store in the UAE) that iMessages would work but conceded that FaceTime wouldn't. My iTunes account is registered in the uk and my daughter's iPhone has iMessages even though she bought it (and uses it) in Dubai. Can anyone else throw any light on this?

  • Can a use a partitioned external hard drive to create a disk image? I tried, doesn't seem to work using disk manager.

    Can a use a partitioned external hard drive to create a disk image? I tried, doesn't seem to work using disk manager.

    OK, it's very bad computing to use a backup disk for anything but a backup. The reason being is if/when the HD crashes you will have lost not only all your backup but the data files. While I commend you for wanting redundant backup, you really need separate EHDs for doing so. Format each EHD using Disk Utility to Mac OS Extended (Journaled) using the GUID parttition. When you connect, OS X will ask if you want to use that drive as a Time Machine backup drive, select yes and then let it backup. On the second EHD format the same way however do not use TM as a backup, this time I'd suggest an app such as SuperDuper or Carbon Copy Cloner to make a clone of the internal HD. Leave both EHDs connected and TM will backup new or changed files automatically on a hourly basis. The clone you will need to set to backup on the schedule you want. For example I have my SuperDuper EHD set to backup only changed or updated files at 2AM every day.
    The advantage of a clone is that if the computers internal HD crashes you can boot from a clone and continue working, TM will not do that but it's great for keeping an archive of all files. So if you want a version of a file from many months ago, TM will help you locate and restore it.

Maybe you are looking for

  • Photoshop Elements 11 and Metadata Working Group Guidelines

    Could you please let me know whether Adobe Photoshop Elements 11 is fully compliant or not with Metadata Working Group Guidelines? Thank you

  • Message Driven Bean Concurrency

    Hi: I am working with message-driven beans (MDB). My understanding was that these beans would read and execute concurrently. My tests show they do not. I have setup a single MDB which contains the following trivial implementation of onMessage... publ

  • Can't edit include file in the enhancement.

    Hello expert:          I want to do enhancement for datasource, after I click into include file ZXRSAU01, I click chang button, the whole include file turn to white, I was not allowed to edit in the include file. please tell me how to resolve it? Man

  • Asset Deprsiation and Material Linking

    Dear Experts I have Material M1 costs 50 K and Asset A1 is created from M1 having value 50 K .Equipment E1 is created with from asset A1,After 5 years asset value(Equipment ) is 16.6 (@20 % deprsiation) .Now Equipment is to be sold , I want reverse S

  • Brand New Ipod, Need Help QUICK!

    its a brand new ipod, i wanted to update it, and it froze, it is stuck on the "Do Not Disconnect" screen, the only way i get it off this screen is if i actually disconnect... than when i reconnect it just does the same thing, and no, it does not have