Avoiding audio clipping in mix from jsresources example

I am looking at the AudioConcat example from jsresources
http://www.jsresources.org/examples/AudioConcat.html
to help me mix some wav files (44100 16 bit signed)
It seems that there is no protection for audio clipping in the code. From the little that I know about audio, the max positive value for a sample in a 16 bit sample should be 37627 so around line 250 I added this check
              if (anMixedSamples[nChannel] > 37627) {
               anMixedSamples[nChannel] = 37627;
}but it did not seem to do anything
Any assistance would be apprciated

malc61 wrote:
It seems that there is no protection for audio clipping in the code. Check around line 268...
                    if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED))
                         switch (nSampleSize)
                         case 1:
                              abData[nBufferOffset] = (byte) anMixedSamples[nChannel];
                              break;
                         case 2:
                              TConversionTool.intToBytes16(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian);
                              break;
                         case 3:
                              TConversionTool.intToBytes24(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian);
                              break;
                         case 4:
                              TConversionTool.intToBytes32(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian);
                              break;
                    }I'd imagine those conversions handle overflow internally.

Similar Messages

  • Upon saving, GB alters audio clip, stretching it from 4 to 4.5 bars

    Here is the problem: I have a song with a 4 bar "real instrument" clip in it. I alter the song. Resave it as another file name. When I reopen the song, the clip plays back incorrectly (too slow). It plays over 4.5 bars, not 4. Sometimes, it actually shows the clip stretched out to be 4.5 bars. Needless to say, this ruins the song. I have not touched this clip between the time I play it ok, then save and it plays too slow.
    Any suggestions gratefully accepted!
    PS Although I just posted about this problem, I thought it had to do with the mobile pre interface, but that was a red herring. It is the same with the interface or with internal audio. Thank you.

    For what it's worth -
    I erroneously stated earlier that the "Mobile" quality video played well in QuickTime & iTunes.  That's not true.   When I converted/downlaoded the same video from Clip Converter using the Mobile settings, the sound is messed up in bot programsh.  The specs for the filer are:
    The same clip played & sounded well in both Quick Time & iTunes (but not on iPhone) when downloaded at Standard Quality (360p - specs in previous post).  
    I notice the FPS & the Data Rate of the "Standard" clip are out of parameter based on the requirements I quoted.
    Really all I want to know is how to download some YouTube videos & get them to play well on my iPhone.  If I can learn to understand the hows & whys, that'd be great too.  But definititely secondary!
    Cheers.

  • When I have two audio clips next to eachother, how do i 'dissolve' them so its a smooth transition from one to the next?

    I have a few clips besides eachother.. levels are up and down, but i want to do an 'audio dissolve' per se, or fade from one audio clip into the other.. to make it smooth..  how do i do this? thanks

    One might think that you could simply drop a transition effect on to two connected audio clips to fade from one to the next. In fact, that's what the menu seems to imply:
    But you can not. No transition effects can be attached to Connected Clips. The menu lies!
    There are however several ways to do accomplish the transition.
    You can overlap them and drag the fade gadgets like this:
    Another way is to transform the audio clips to a secondary Storyline (command-g). This will allow you to use transitions.

  • How do I stretch or compress an audio clip without changing the original?

    When I drag an audio clip, like footsteps, from the browser library into the timeline or sound editor, and then time stretch it or compress the speed, all instances of that clip seem to change with it. How can I make different speeds of the same clip in various instances in the timeline? And do it so that the original clip from the browser is still at the original speed when I drag it in again?

    For each instance go to *Clip>Replace With Independent Audio File Project*

  • I have an iMovie that I created 10 years ago.  I found the disk and imported.  Everything is there except the sound!  I converted in Wondershare to MPV4 but still no sound.  There is an audio clip that was imported from an analog video camera.

    I have an iMovie that I created 10 years ago.  I found the disk and imported.  Everything is there except the sound!  I converted in Wondershare to MPV4 but still no sound.  There is an audio clip that was imported from an analog video camera.  Does anyone know how I can get the audio back?

    Whitelab Records wrote:
    So, 20 views and nobody's anybody the wiser?
    A small update to this issue....
    I have been trawling the forums to find an answer but to no avail...
    And... I've tried exporting and bouncing individual stems and the full session, either by muting all bar the stem or soloing the stem.....and still nothing.
    Same problems.....everything is audible in audition but nothing plays on playback.
    Since the 'prelisten' channel strip is Solo safe this would indicate that you have a track or channel strip soloed somewhere else, out of sight. Are the Mute buttons on your channel strips blinking?
    To view all objects in your mixer, click the button. You may have to scroll sideways to check the whole mixer.

  • Control surface toggle audio clip mixer

    Thought I'd post this as it took me some time to work out it was possible.
    External control surfaces now work with the Audio Track Mixer, but I couldn't find a way (or any info) on how to make it work with the new Audio Clip Mixer. Eventually I found 'Toggle Control Surface Mixer Mode' in the keyboard shortcuts and now everything is working well in both modes.
    This works for mute, solo and level in the Clip Mixer. I've not yet attempted any automation, I can't see a way to turn on the 'record keyframes' other than manually one track at a time. Still, progress to this point is very welcome.

    The Mackie device has some quirks, and while basic functionality is there, PPro does not have as strong support with mackie as it does with eucon through the avid artist series.  The physical MCU keys switched between different versions of the device and what is undo on one is a different function on another, so sadly, depending on what model you get, those buttons may or may not be correct by the label that is on the device.  There is no way for us to tell which one you have.
    Clip mixer mode can be enabled either through the fly out menu in the clip mixer or by assigning a keyboard shortcut.  When engaged, it supports the faders, pan/balance/mute and solo.  If automation is engaged it will record automation, though you can't engage clip mixer automation via the control surface like you can on the track mixer.
    Unfortunately there is no way to group channels at this time, aside from making a submix, but I do not think this is what you were requesting.
    There is not a way to manually enter a keyframe via a button on the control surface.
    It is possible to customize some of the control surface buttons by hitting the button assignments button in the Mackie control surface window.  This is mostly limited to the function keys and a few others
    The touch and latch mode lights is a known bug.
    If you want more customization, the Avid Artist series has much better support in this regard.  We set up many soft keys, but you can also create your own very easily. 
    I will take a look at the other issues you have raised as they sound like bugs, but I also encourage you to file them through here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform as it will help us to gauge how many are using the mackie protocol vs eucon.
    Thanks
    Todd

  • No sound when playing an audio clip from a website

    I'm trying to play an audio clip on a website. The site shows that the clip is playing, but I have no sound. My speakers are on and none of my volume mixers are muted. I played a clip from a different website and had sound. I spoke with Customer Service for the website where I'm not getting sound, and they tried playing the same clip on their computer, using Firefox, and it played the sound. I also tried playing a different clip on the same website, but again didn't have sound.
    I'm using Firefox 16.0.2 on Windows XP

    You can click the Volume icon on the Windows Taskbar near the clock and click the Mixer link at the bottom to open the mixer.<br />
    You can adjust the volume level for each application in that window, so make sure that Firefox is not muted or set at a low level.<br />
    Current Firefox versions use the plugin-container process to run plugins, so you need to check the volume setting for the plugin-container process.<br />
    You will only see the Firefox program or the Plugin Container in the Mixer if you are on a website that plays sound.
    See:
    * https://support.mozilla.org/kb/No+sound+in+Firefox
    * https://support.mozilla.org/kb/Video+or+audio+does+not+play
    You can clear the Flash local storage and settings if the Flash player is involved.
    *Windows Control Panel > Flash Player > Storage: Local Storage Settings
    **Remove a specific domain: Local Storage Settings by site
    **Remove all domains: Delete All and Delete Data
    Flash Website Storage Settings panel:
    *http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html
    Global Storage Settings Panel:
    *http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html

  • How do I stop background audio clips from playing while browsing sites?

    Firefox is my default browser. I use Google chrome and Internet explorer sessions for background monitoring news site sessions at the same time. I have no problem with the other two browsers. While surfing with Firefox I get unwanted background audio clips that start and run by themselves. I cannot stop them. They run and then stop by their self. They are some sort of adware and I cannot find the source to remove them. I also get video clips sometimes that I can stop that run around the outside of the active window I am viewing. These is very annoying. I have uninstalled Firefox and reinstalled it but the problem does not go away. I antivirus software, registry change protection software, and registry cleaning software. The problem is with the default browser.
    How can I locate and remove the plugin, addin or service that starts this annoying activity. I have no special unwanted toolbars installed. There is nothing in the installed programs list in the control that shouldn't be there.

    I had a similar problem to this. EVERYTIME i started firefox, it would play an audio clip from a flash game i played a while ago, it would last 5 minutes before finishing. i tried the starting in safe mode, but that didn't work for me, so after that i then tried RESETTING firefox, and that has worked for me.
    On another side of startup problems, firefox would also open up a new tab on startup, usually 22find.com or do-search.com. i know these are caused by a virus and have since deleted it, but it had changed a preference file in firefox causing it to continue to open on startup.
    Having since done the firefox reset, i haven't had either of these problems AT ALL! would recommend this as a possible fix for you friend before trying any lengthy troubleshooting process or downloading any extra anti-virus removal software.
    here's the like to showing you how to reset firefox: https://support.mozilla.org/en-US/kb/reset-firefox-easily-fix-most-problems

  • Is it possible to have the same audio clip be playing nonstop between menu's in idvd '11? I want to be able to go from one menu to the next without the audio cutting out on me. Thanks for any support! I have tried searching the forrums but no luck yet.

    Is it possible to have the same audio clip be playing nonstop between menu's in idvd '11? I want to be able to go from one menu to the next without the audio cutting out on me. Thanks for any support! I have tried searching the forrums but no luck yet.

    No.
    OT

  • Drag & drop audio clip from timeline to project window ?

    i no longer can drag a clip from timeline to the project window & then breakout the clip to mono by selecting clip - audio options- breakout to mono - now when i drop an audio clip from timeline into the project window it does not show up anywhere in the project window - did an update get rid of this function ? it was much better than having to go back to the unedited original source & start from scratch ...

    thanx for your time Jim - i understand that would be the preferred method but that was a quick fix until recently i have noticed that i can no longer do it by just grabbing the edited clip & drop it in project window so that i can modify just that portion of the original files properties - it still functions that way on a friends machine - was just kinda weird that i can't get it to work that way any more …

  • Editing Multiple Audio Clips From Premiere in Audition

    Hi there,
    I am working with video/audio in Premiere that has frequent cuts (although the audio is derived from two files) and I need to edit all the audio files at once, rather than one by one, in Audition. I was hoping to this by nesting the audio in Premiere but I am not able to edit the nested file in Audition after this.
    If anyone has any ideas of how to work with and apply the same properties to multiple audio clips from Premiere in Audition I would greatly appreciate it.
    Thanks...

    Hi everyone, I also have a trouble with cs6. I just record 3 tracks in the early today, then when I got home, I saved as sexs file ( wrong decision). After that, I went back and try to open the file, it can't file the recording tracks. The only one thing still exist is my beat, what should I do to recovered it? thanks for helping me out of this.

  • Premier Pro 2014 opens Audition CS6 when editing audio clip from Premier

    I own Adobe CS6 Master Collection installed (for legacy projects) and I also have the CC subscription. When I am running Premier Pro CC 2014 and then try to edit an audio clip in Audition the CS6 version of Audition loads rather than the CC 2014 version. Any help or thoughts on why this is happening would be appreciated.
    KR

    I detected this with photoshop--I think its an OS issue--The OS doesn't appear to recognize the two versions are different.  In my case, I had PSP CC loaded, but then loaded the 32 bit version of PSP CS6 (so I could scan directly into the program using "IMPORT")  Windows changed the default to the 32 bit version.  When I tried to change default using windows, windows would not show the CC version as an option--just the 32 bit version.  Without editing the registry, I couldn't find a way to force windows to ignore the 32 bit version and open the CC version.  My workaround was to always open the CC version from the icon and then click on the file I wanted open.  It appears that if any version of the program is already running, the recognized default won't open.  This might work for you on Audition.

  • How do i play an audio clip from a server?

    I am trying to play an audio file on another server, for example:
    URL url = new URL("http://example.com/hello.wav");
    AudioClip click = Applet.newAudioClip(url);
    click.play();This doesn't seem to be working, can anyone tell me what I'm doing wrong?
    Thanks very much.
    Edited by: JavaJenius on Mar 7, 2008 6:47 PM

    Use a SwingWorker:new SwingWorker<AudioClip, Void> () {
        protected AudioClip doInBackground () throws Exception {
            return Applet.newAudioClip (new URL ("http://www.geocities.com/darrylbu/sounds/ringout.wav"));
        protected void done () {
            try {
                get ().play ();
            } catch (ExecutionException ex) {
                ex.printStackTrace();
            } catch (InterruptedException ex) {
                ex.printStackTrace();
    }.execute ();Depending on your need, you may want to make that a named class AND/OR assign it to a variable reference and call execute separately AND/OR you may want to call loop () instead of play () inwhich case you may want to assign the AudioClip to an instance field so that stop () can be called from any method.
    For a console app, I would have recommended a Thread:new Thread (new Runnable () {
        public void run () {
            try {
                Applet.newAudioClip (new URL ("http://www.geocities.com/darrylbu/sounds/ringout.wav")).play ();
            } catch (MalformedURLException ex) {
                ex.printStackTrace();
    }).start ();The same reasoning applies.
    Please read the API for anything you're not familiar with, and get back if you have any questions.
    db

  • Adobe Premier Pro CC won't write tracks in Audio Clip Mixer

    Hi!
    For some reason the Audio Clip Mixer controls aren't functioning after I "write" the track in mix down.  The track reverts to "touch" upon play back, but nothing took hold.  Any suggestions?  Is there something I need to enable first to make the "Write" function...function?
    thank you!
    Scott

    You probably mean the Audio Track Mixer.
    If after writing it reverts to Latch that is a setting you can turn off in the panel menu.
    Did you add a keyframe to start writing.

  • Facebook has challenged the copyright of a movie using iMovie audio. Am i allowed to share movies made using audio clips from iMovie?, Facebook has challenged the copyright of a movie using iMovie audio

    Facebook has challenged the copyright of a movie using iMovie audio. Am i allowed to share movies made using audio clips from iMovie?

    Just curious as to why it's coming up as a copyright violation?
    Hard to say.  I think FaceBook errs on the side of abundance caution when they detect anything that sounds like music.
    It's also possible to that people use samples of various pieces of iLife audio contest to create a piece of work that they then copyright.
    Matt

Maybe you are looking for

  • How to connect two macbook Pro

    Hi I want to connect the new MacBook Pro Retina to my older MacBook Pro for transferring all my data. Problems: the new one has no ethernet plug in but the thunderbolts ones, which of course don't exist on the old one;;; Which cable can i use? Can't

  • Can't install Snow Leopard, please help

    I just purchased a new SSD and put it into my MacBook Pro and am replacing my old HDD. I also just purchased Snow Peopard as I lost my original discs and can't see to even run the os install disk. When I power on my MBP it just stays at a blank white

  • Switching from 1.3 to 1.4

    I have decided to make the switch from Java 1.3 to 1.4, and along with it, I needed to implement new printing procedures. But, alas, these new procedures require classes that are not in java 1.3. Now, it turns out, many of my customers haven't and do

  • MVRedlineTool cannot be used to create Polylines?

    Is it possible to prevent the MVRedlineTool object from automatically closing the user defined shape (i.e. joining the first and last points to form a polygon) when the generate() method is called as part of the MVEvent.FINISH event listener. My requ

  • Need to change my country store

    Need to change my country store but says I need to spend all the money in order to be able to change the store. And I only have 0.13 Dollars. Can anybody help me to know the way to spend those cents? Thank in advance for help