Audio "skips / stutters ' second time it is played.

I am building an app that reuses several sounds again and again. I'm running a problem with the audio tag when a sound is reproduced.

The first time that the sound is played he plays well, but sometimes it "stutters" at the beginning of the sound clip.

I broke it up to its simplest form:



sound test


 
 

I posted a working example at http://www.tristancater.com/playbook

It's works fine in chrome, but you will live the stuttering through the browser of the PlayBook.

I know that I can recreate the sound whenever I want to use that eliminates this problem. But this, I was running in the memory of the questions because each audio clip is loaded into memory and I could not find a way to free him.

her var = 'Right ';

function playSound (sound) {}
SND = new Audio (sound + ".mp3");
SND. Play();
}

I thought I had found a work around for this in this way:

her var = 'Right ';

function playSound (sound) {}
SND = new Audio (sound + ".mp3");

snd.addEventListener ("finished", function() {}
SND. SRC ="";
(}, false);

SND. Play();
}

This solves the memory eating question however, that random application crashes.

I'd love to hear all of the solutions to repeat audio. I'm sure it's a common thing in games.

I also had trouble with HTML5 audio on the PlayBook, and I found a solution that seems to work perfectly well.

First take a look at the Tunneltilt sample of BlackBerry:

https://github.com/BlackBerry/WebGL-samples/tree/master/tunneltilt

See the 'sounds.js', "Readme.md" and the folder blackberry.custom.audio files

They play using an adobe air extension, not not not using HTML5 audio. This extension has absolutely no problem with playing multiple sounds at the same time and the sound is clear. There are some things to notice, you:

  1. I wasn't able to play wav files so I had to convert all audio files to mp3
  2. Audio files may not be too short, so I added some silence at the end of the sound. My tests, I found that the audio files must be at least 130-130 milliseconds long.
  3. Ripple (in its current version) emulator does not support the extensions, so you hear no noise up to that deploy you your application.

Here is an article that deals with extensions:

http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/tutorial-for-writing-WebWorks-ex...

Just one last thing. I think they have a leak memory in the extension code, so here's my version of the file 'CustomAudio.as ':

package blackberry.custom.audio
{
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.media.SoundTransform;
    import flash.net.URLRequest;

    import webworks.extension.DefaultExtension;

    public class CustomAudio extends DefaultExtension
    {
        public function CustomAudio() {
            super();
        }

        override public function getFeatureList():Array {
            return new Array ("blackberry.custom.audio");
        }

        public function playFile(eFileName:String, eLoops:int, eVolume:Number, ePan:Number):Number {
            var req:URLRequest = new URLRequest(eFileName);
            var snd:Sound = new Sound();
            var channel:SoundChannel = new SoundChannel();
            snd.load(req);
            var pausePosition:int = channel.position;
            var sndTransform:SoundTransform = new SoundTransform(eVolume, ePan);
            channel = snd.play(pausePosition, eLoops, sndTransform);
            return 0;
        }

        public function setVolume(eSoundID:Number, eNewVolume:Number):void {
            //this method has been disabled
        }
    }
}

It will be useful.

Tags: BlackBerry Developers

Similar Questions

  • WMP 12 plays 2 songs at the same time. If a piece is played and I spend almost another song, the second song starts to play and the first

    A frustrating problem with wmp on my new laptop of ASIS Windows 7. During playback of an mp3 file, if I hover near a second file, the second file starts to play in the first.

    The system is used for dance classes, and I need to have the ability to choose a second track spontaneously.

    This does not happen with the previous version of wmp (11).

    The problem would be the touchpad on the laptop?

    Charles Todd

    Hi Charles,

    The description of the problem, it looks like Windows Media Player plays 2 different songs at the same time when hover near a second file in Windows Media Player.

    You can run the troubleshooting Windows Media Player Settings Troubleshooter & check if the problem persists.

    Troubleshooting of Windows Media Player settings

    http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter

    Please come back with more queries on Windows, we will be happy to help you.

  • Last second audio skips and repeats after upgrade 2015.3

    The question:

    Hello everyone. I just upgraded to 2015.3 and have noticed a problem since. When I made a file (file > export > "Add to Adobe Media Encoder Queue") the last second or two of the audio track bounces and repeats. It's a workflow I've used for several years without problem until today.

    Troubleshooting:

    I checked triple file hearing and resulting. WAV to ensure that the question was not there. I ran the audio by itself through the SOUL and it is fine. I dropped videos I did with slightly different parameters directly in the SOUL, and it travels very well. But when I export EI by SOUL - no matter what presets that I use in SOUL - the audio Bobbles in the end.

    As an experiment I did a long model of twenty second with audio long ten seconds followed. When I made the comp, the result was interesting - even though the audio file was only ten seconds of time, the last second of the audio track repeat endlessly through all twenty seconds.

    I deleted all my _AME folders, rebooted my Mac, created a new AE comp to scrape, interrupted audio, and had made the same question. (I was kind of hoping it would be a memory issue).

    The question seems to exist that in the link between AE and SOUL, but for the life of me, I can't find a setting to shake the bug...

    Technical information:

    27-inch iMac 2011 Mid, 2.7 GHz Intel Core i5, 16 GB RAM, OS X El Capitan v 10.11.5. I use version 2015.3 of the creative cloud, downloaded and installed last night.

    AE Comp settings (it is not editable because the company I work for has very strict guidelines): 1920 x 858, Square Pixels, 24 frames per second, full resolution, comps are every twenty seconds.

    Parameters of the SOUL (even once, it cannot be changed according to the requirements of the company): H.264, audio and video, export 1920 x 858 (1.0) 24 fps, progressive VBR, 2 pass, target 20.00 Mbps Max 22.00 Mbps, AAFC, 256 kps, 48 kHz, stereo. The only 'effect' that we use is vital - "Normalization of loudness" using the standard ATSC A/85 (LUFS-24).

    Any help would be appreciated - my workload is very heavy and the deadlines are tight. I have a good number of files requiring rendering in the next few days...

    There is a bug in after effects CC 2015.3 (13.8) where export your composition via Adobe Media Encoder cannot make audio correctly. Audio can be repeated at the end. It's only a problem with the audio, the video is not affected.

    The After Effects team is aware of this problem and is working on a fix. Until that is available, we recommend that you either:

    • Export with audio compositions using the queue of rendering in After Effects for an intermediate file (e.g., QuickTime with the GoPro CineForm, Avid DNxHD/HR or Apple ProRes codecs) and then transcode the file in the final format using SOUL. (Look at the SOUL records are very useful for this).
    • Install After Effects and SOUL CC 2015.2 and export with audio compositions using this version of the SOUL. Project files saved by after effects CC 2015.3 are compatible with previous versions of CC 2015 (a few new features, of course, won't be available). You can either add the composition in the interface of the SOUL, or open after effects CC 2015.2 (13.7) and use the add to the command queue SOUL there.

    Our apologies regarding this bug.

    (Under the hood: the problem is with the new audio architecture, which does not take into account segment size which requires of the SOUL for audio encoding.) The length of the composition should correspond to a multiple of the segment size requested, there will be no problem, but in most cases, the length of the composition does not match a multiple of what awaits the SOUL and SOUL filled the rest with audio Rassi is still in the buffer).

  • When the press the play button, how we get information of angle in every second time bar?

    proje123.png

    When the press the play button, how we get information of angle in every second time bar?

    You can get the values of rotation for each image by calling the method. valueAtTime() on the Rotation property. So, if you want to know what the value is at the 2 second mark...

    layerObj.property("ADBE_Transform_Group").property ("ADBE Z rotation").valueAtTime(2, false);     'false' includes the results of the expression, 'true' does not work.

  • Has been able to play games downloaded the first time, but can't open the second time I try

    Original title: could not open the file

    I downloaded a few games and the first time, I could read, but when I tried to open the second time, they just won't open.

    It would show the loading symbol, but nothing happens?

    Help?

    Hello

    • Did you follow the steps?

    Try to run the game in compatibility mode and check.

    Make the programs more compatible with this version of Windows

    http://Windows.Microsoft.com/en-us/Windows-8/older-programs-compatible-version-Windows

    If the problem persists, try to uninstall and then reinstall the game and check if this may help. You can also post your question in the support forum for Big Fish Games and control upgrade game.

    http://forums.bigfishgames.com

    Hope this helps

  • His stuttering each time playback is stopped.

    Whenever I have stop any program this time audio/video, the sound stutters for several seconds. It seems as if he's stuck in a feedback loop. I've updated the Vista drivers for my sound card and it does not solve the issue. I am running Vista Home Basic with SP2. Any ideas as to the cause or solutions?

    Hello

    ·         You will remember to do recent changes on the computer before this problem?

    I suggest you follow the steps below:

    Method 1:

    You can follow this section "By my speakers is crackled or distorted" in the link below:

    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-fixing-common-sound-problems

    Method 2:

    I understand that you have already tried updating the drivers, please to uninstall and reinstall the audio drivers completely, follow these steps:

    a. click Start, type Device Manager in the Start Search box and press ENTER.

    b. click continue. The Device Manager dialog box appears.

    c. If you are prompted for an administrator password or a confirmation, type the password, or click continue.

    d. in r management device, right click on audio and its driver and click on uninstall.

    Restart your computer and Windows vista will automatically reinstall the audio drivers.

    Also, follow the steps in the link below:

    http://Windows.Microsoft.com/en-us/Windows-Vista/how-do-I-stop-my-music-from-skipping-or-breaking-up-when-I-play-it

  • Audio skips during playback

    reading

    each track has a boring jerks a few seconds from the end, it does not work hoever tranfer on disk when reading burnt.only.

    Hi Mondobee,

    • You have a third-party codec pack installed on the computer?

    If you have any third-party codec pack installed on the computer, you can try to temporarily disable the codec pack or try to uninstall it and check if the movies and songs to jump into Windows Media Player. Later, reinstall or enable the codec pack after verification.

    I also suggest you to disable improvements audio speaker and check if it helps you difficulty jump her.

    To disable the audio improvements speaker, follow the steps below:

    A. Open Audio devices and sound themes by clicking the Start button, clicking Control Panel, hardware and sound, then clicking sound.

    B. on the playback tab, click speakers and then click Properties.

    C. click the enhancements tab, and then check Disable all improvements.

    If you do not see the enhancements tab in the speakers Properties dialog box, these features are not available for your speakers, and this procedure is not applicable to your computer.

    If disabling audio enhancements solves the problem you are having, this indicates that your audio driver should be updated.

    Access the link below to learn more about the music stop to jump into Windows.

    http://Windows.Microsoft.com/en-us/Windows-Vista/how-do-I-stop-my-music-from-skipping-or-breaking-up-when-I-play-it

    I hope this helps. Let us know the results.

    Thank you and best regards,

     

    Srinivas R

    Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Second time all my music was gone

    This is the second time that this has happened, all my music on my phone just totally disappeared!

    My phone is an iPhone of 128 GB 6 s more working 9.3.1

    First time it happened I was listening to my music through my headphones, I stopped to talk to someone, you press play and nothing happened, had a look - ALL my music was gone. Everything else like photos/contacts etc were always there, that music has been removed. Not sure what ios I was running then, it was about 3/4 months ago not sure at 100%.

    Second time this has happened was Saturday, April 30, I'm in my car for a weekend went away, to play music via bluetooth - DISAPPEARED again. All tracks, but still all of my photos etc always here and phone works perfectly well.

    I have is home today, plugged in my phone to my pc and start iTunes, all my playlists were still there, but the music was gone.

    I can't for the life of me think what is the cause, its taken me about 3 hours to put everything back on how I want to.

    Can anyone shed some light on this for me?

    If it happens again, I may return the phone to my network provider

    How your music is getting to your phone?

    Synchronize with iTunes? iTunes purchases? Apple's music?

  • Audio skip vista and offline

    Audio skipping on and off line. first of all, I noticed on netflix watch 24 today.

    yesterday, I installed vista service pack 2 update, and then ie9. has summer

    impressed with ie 9 - quick, but now jump audio into i tunes offline

    and sky go and netflix online. and everything probably. I have a

    Custom reference dell xps 540 quad with audio 5.1?

    The following link might be worth a visit:

    Windows Vista - How can I stop my music skip or break down when I play?
    http://Windows.Microsoft.com/en-us/Windows-Vista/how-do-I-stop-my-music-from-skipping-or-breaking-up-when-I-play-it

  • Becoming audio unsync with animation unchecking after "continue playing project."

    Hello.
    When I add a link to another page (open in New) and uncheck the 'keep playing project', audio, I added is not a break with the rest of the slide. This creates a confusing delay between animation and sound, where the user does not know that the animation is paused.

    Is it possible to break the audio at the same time as the slide itself?

    This causes a lot of confusion with of many CP users. There are two types of breaks:

    1. The 'absolute' break caused by the command "Pause". Who will take a break on the timeline, including audio clips already underway, video.
    2. Break due to an interactive object that has checked in his timing of break properties: it stops at the playhead, thus preventing the objects that should be included in the slide after the suspension point to appear. However, the slide that began to play before the break audio will continue to play, unless you check "Stop Slide Audio" under the Options tab of this interactive object. Even with the audio object.
  • First second preview will not play

    My preview will play, the only thing he won't play on the first second of any preview. It is just on the first raster image and then pop on about a second later - it however play audio while holding the first image. If she plays again until the end and loops, it will then play the entire segment.

    This is AE 2014, Mac 10.10.3 (Yosemite) 16 GB of ram

    That's what I tried:

    -Restarted AE
    -Mac restarted
    -Updated to the latest version of the AE

    -Purged cache memory

    This is a bug introduced by Mac OS x v10.10 (Yosemite). We have worked around this bug to Apple in the After Effects version under development, which is targeted for release next month.

  • Prevent the timeline to replay a second time click on the trigger

    Hello. How can I prevent the timeline of a symbol to restart when a second time the button trigger and the timeline has already run. I have a line that grows when I click on the button and I want to keep it as. When I click on the button again the line jumps to its original size.

    Thank you

    Add a variable on the scenario of the symbol.

    var a = 0;

    then in your event click in compositionReady use:

    {sym.$('buttonName').bind ('click', funciton ()}

    {if(A==0)}

    sym.getSymbol('name').play ();

    A = 1;

    } else {}

    sym.getSymbol('name').stop ();

    }

    or you could untie your click event

    {sym.$('buttonName').bind ('click', funciton ()}

    SYM.$('buttonName'). Unbind ('click');

    sym.getSymbol('name').play ();

    }

  • For the second time in two months, all my messages in the Inbox are not there. Only the SUBJECT and the FROM is left. Tried to 'fix this folder' and lost ALL

    For the second time in two months, all my messages in the Inbox are not there. Only the SUBJECT and the FROM is left.

    Tried to 'fix this folder' and ALL - lost ALL the Inbox.

    The file is still there and works well...

    How can I stop it and what are the causes?

    Thank you all, Gabe

    If you have the file somewhere on your hard drive, export and import tools it will be important back to Thunderbird.

    https://addons.Mozilla.org/en-us/Thunderbird/addon/ImportExportTools/

    Instructions http://chrisramsden.vfast.co.uk/3_How_to_install_Add-ons_in_Thunderbird.html

  • For the second time in six months, Thunderbird seems to have lost all my emails content.

    I have Thunderbird loaded on a MacBook Pro. For the second time in six months, disappeared the conent of all emails. I have a list of emails, but the content does not appear in the reviewing pane or if I open the e-mail. I made no changes to the computer Professor at Thunderbird. It's very frustrating! Any ideas as to what is happening?
    Mike

    Do you also have an anti virus program for the second time in six months has quarantined you Inbox?

  • Show Microsoft Excel files in the download, but only empty software opens. You must then click on the link a second time for the file to open. ? Exchange

    By clicking on the links to files that Excel, used to work. In the last weeks of 2 (?) files are not open. I want to talk of the basic old .xls files.

    Clicking once, opens the Excel software only.
    Double click on open two windows with empty Excel software.
    By clicking on one to open the software. And then to go back to click a second time open the actual file.

    On all clicks, download popup box indicates the file to download. And no it does not appear on my desktop or in any other file.

    What you have in the following list - mine are all set to "always ask":

    Orange Firefox button or classic menu Tools > Options > Applications

    In the search above the list box, type or paste Excel to filter the list.

    You have additional modules related to the registration or downloading files that may affect the .xls files? You can review your modules here:

    Orange Firefox button or classic menu Tools > Modules

    Check the Extensions and Plugins categories.

Maybe you are looking for

  • Qosmio X 770-00 X and Microsoft Flight Sim 2004 3D gaming

    I have a new laptop of X 770-00 X. So far, I was able to get videos to play in 3D using the video player from Toshiba. I have Microsoft Flight Sim 2004. The Nvidia control panel says that it is a compatible and will be in 3D. How to run 3D? The 3D on

  • G9 remote shutter release

    I have a Canon Powershot G9 and I would like to be able to trigger the camera remotely using a wireless remote control. There is no (apparent) plug to allow me access to this function The mini - USB port (under the digital 'AV Out' flap) allow me in

  • Phone cord 4632 Officejet printer

    I'm not sure that the power cord from the wall outlet at the rear of the printer seems like and therefore can not find mine.  The instructions say to use the 'phone cord supplied' or any phone cord will work just as well?

  • WAG310G drops wireless

    Hello My WAG310G quite often (about once per day) loses wireless connectivity. In other words, the 2 computers that I have connected via radio lose their connections. 3 computers, I've connected on net cables not have these problems. The only way to

  • More information on packages

    Good day everyone, Is there anyone who knows when the RadioInfo.getNumberOfPacketsSent() and RadioInfo.getNumberOfPacketsReceived(); is deleted? Is there someone who has the most information on that? Thank you