ArrayIndexOutOfBoundsException with 16 bit audio

Hi, when converting 8 bit audio I have no exceptions, but when converting 16 bit I get an AIOOBE. Here is the code segment that deals with the conversion:
try {                          
  for (int r=0; r < audioShortData.length-1; r++) {
    loByte = audioByteData[r * numChan + 0];                
    hiByte = audioByteData[r * numChan + 1];
    //convert bytes to int
    sample = (hiByte << 8) | (loByte & 0x00FF);
    //samples array
    audioShortData[r] = (short)sample;
} catch (Exception ex){ex.printStackTrace();}The exception is pointing to: loByte = audioByteData[r * numChan + 0];
Thanks!

My proposal:
try {                          
  for (int r=0; r < audioShortData.length; r += 2) {
    loByte = audioByteData[r + 0];                
    hiByte = audioByteData[r + 1];
    //convert bytes to int
    sample = (hiByte << 8) | (loByte & 0x00FF);
    //samples array
    audioShortData[r/2] = (short)sample;
} catch (Exception ex){
  ex.printStackTrace();
}Just a quick guess, I'm pretty sure I can't think straight anymore right now.

Similar Messages

  • Exporting from PPro CC - Exporting using Match Sequence Settings issue with 24 bit audio

    I am having an issue exporting my sequence which contains final AIFF mix (24 bit 48 kHz) into a 'same-as-source' ProRes 422 file with 24 bit audio. I am specifically trying to export media with 'Match Sequence Settings' checked to create an identical output of what my sequence is. I wind up only creating a PR422 with 16 bit audio rather than 24 bit audio.
    My sequence contains ProRes 422 media and 24 bit AIFF final stereo mix (1 audio file) from our Sound department.
    My sequence is currently setup as "Custom" at 1920x1080, 23.976 fps, Square Pixels, Progressive, etc. Audio is 48 kHz (I don't see an option for choosing different bit rates in the 'Sequence Settings').
    Using 'Match Sequence Settings', my options to alter the audio are "greyed out" and unavailable. I'm not sure why 'Match Sequence Settings' doesn't recognize that I am cutting with 24 bit audio and, instead, only exports 16 bit audio.

    Always skip Match Sequence Settings and set up the export manually.

  • Setup for Panasonic PV-GS400 with 12-bit audio

    I've some tapes recorded in 12-bit audio. What do I select under easy setup to avoid audio/video sync error messages later on?
    Moving ahead I will use 16-bit audio on the DV cam. What settings do I alter?
    Thanks - basic stuff I know - just gt FCE.

    Hi
    I'm a lucky bloke. I got a wife with a second Camera.
    Camera owning friends. If just a few tapes it could be a reason for a nice
    come together.
    Yours Bengt W

  • Can any one help me with CD/Audio disc playback problem on media center m8200n running Windows Vista

    I have HP Media Center m8200n Dest top running WINDOWS VISTA HOME PREMIUM 32 BIT edition.It  has MEDIA CENTER and MEDIA PLAYER. I experience problems with the computer being able to play CD music discs.  What happens is that the Disc will play only for 63 seconds exactly and then stop playing the track, the player will then skip tracks, settle on another one, play it for a few moments and then skip to the end and then play nothing. It gives me an error message that it cannot read the disc.  This happens with any and every standard store bought CD new or used. These CDs also do play on my laptop running basically same operating system.  This happens whether I trying to Play a disc or burn the disc to the hard drive.  The drives work great though as they do play DATA discs all the way through. MP3 discs play fine.  It also plays the DVD movies with no problem. Windows media player doesn't make it work, also installed VLC player and REALPLAYER to try some other players and they also don't work for music, only DVDs. They all only produce 63 seconds of music play back  from a disc. I've already tried Changing ENHANCEMENTS, UPDATING DRIVERS, UNINSTALLING THE DISC DRIVE and then re-installing back into WINDOWS but none of that helped. SYSTEM came with the integrated REALTEK HIGH DEFINITION AUDIO on the mother boad for multi channel playback options and I've downloaded those updated drivers again but that doesn't do anything.  Thinking it might be a hardware drive problem I purchased a new LG BLU-RAY DRIVE/BURNER super multi drive which plays fantastic for any video format from Blu-Ray to regular DVD format with the Power DVD software but the machine is causing even this new drive to have the same problem with the audio and it cuts out playing the audio disc within the same 63 seconds running audio disc. . There seems to be a software glitch and I'm wondering if you can help.  Also the sound card seems to work perfectly fine. I downloaded I-Tunes and copied over audio files to the computer via my flash drive and when I play those files from the hard drive, or even the sample windows media files which reside on the hard drive in MY MUSIC, all files play through perfectly, fully, and with great sound. Audio out jacks in back of computer work fine as also does the front head phone jacks upfront. Something in the software when playing a audio disc/file through the dic drives???? I've got hundreds of CD and it's a bummer not beng able to lay them through the system. Does anyone think moving from VISTA PREMIUM to a upgraded version like ULTIMATE or even going up to Windows 7 might solve problem??? What about the 32 bit verses 64 bit editions??? My system should be able to run in the 64 bit frame work also. THANK YOU in advance!!!

    Hi,
    All dimms work individually?  Did you run a bootable memory diagnostic to determine the reliability? Did you run a diagnostic on the hard drive?  I believe that your PC came with PC Doctor and that you can create a bootable diagnostic disk. Did you create that disk?  Be sure to purchase memory dimms from a manufacturer that will stand behind their product with a guarantee such as Crucial, Corsair or Kingston. Buy directly from the manufacturer and they will stand behind the guarantee. Be sure that all of the dimms are identical. Use CPU-Z to determine that the specifications are indeed identical.
    You have some options to consider once you can stablize your PC for updating the BIOS.
    Locate a hard drive and use the HP external recovery media to build a VISTA system. -- safest method
    Use a VISTA repair disk and at the command prompt try executing the HP BIOS update (Admin). -- safe
    Try a bootable BIOS update process as suggested at this site. --  less safe but doable
    HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
    HP Photosmart Premium C309G, HP Photosmart 6520
    HP Touchpad, HP Chromebook 11
    Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
    Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
    Windows 7/8 UEFI/Legacy mode, MBR/GPT

  • How do I import AVI video with stereo audio (and keep it that way)?

    Today I just discovered that all the AVI video with stereo audio I've ever imported into a Premiere Pro CS6 project has been mysteriously converted to mono. And I can't find any import setting anywhere that enable me to change this.
    Here's the deal...
    I've have an AVI file with stereo audio (the file is actually a stereo sound test that I downloaded to prove that I wasn't imagining things). On my hard drive, I right-click and view the properties:
    Video
    Length: 00:00:36
    Frame width: 320
    Frame height: 240
    Frame rate: 25 frames/second
    Audio
    Bit rate: 128kbps
    Channels: 2 (stereo)
    Audio sample rate: 44 kHz
    I click on it to play and listen with headphones--everything is playing in the correct part of the stereo spectrum. Then, I import it to Premiere, click the file name in the left content menu, and check the properties, suddenly they read:
    Type: AVI Movie
    File Size: 1.1 MB
    Image Size: 320 x 240
    Frame Rate: 25.00
    Source Audio Format: 11025 Hz - 16 bit - Mono
    Project Audio Format: 11025 Hz - 32 bit floating point - Mono
    Total Duration: 00:00:36:15
    Pixel Aspect Ratio: 1.0
    Sure enough, I drag it into the sequence, listen to it, and it's indeed playing mono. Outside of Premiere, the original source file still reads and plays correctly with stereo sound.
    When I import stereo WAVs and MP3s, it keeps the original stereo channels without me having to do anything special. I even just imported the same exact file as a MOV with stereo audio, and it showed up in Premiere as:
    Source Audio Format: 44100 Hz - 16 bit - Stereo
    Project Audio Format: 44100 Hz - 32 bit floating point - Stereo
    What is going on here with AVIs? Am I doing something wrong? Are there settings I'm missing somewhere?
    (And before anyone suggests I only use MOV in the future... that's not exactly the answer I'm looking for.)

    Thank you for that info.
    For video, the codec is MPEG-4 Video (XVID) and for audio it says MPEG Audio Layer 1/2/3 (mpga).
    There are two issues with that file:
    The first is the Xvid CODEC (not meant for editing), and then the MPEG Audio/MPGA. I would convert that file, to something that is more editable.
    Good luck,
    Hunt

  • How do I get the most of my 24 bit audio?

    We recently shot a project where all our audio was sent to digital recorders at 24 bit, 48k... when I import the files to Premiere there doesn't seem to be any issues, but I can't find settings when creating a new sequence that allows for 24 bit audio (just 12 and 16 bit). If anyone could help me understand the following I would greatly appreciate it:
    1. Are there settings for using 24 bit audio in a sequence? If so, where?
    2. If there are no 24 bit settings, does that mean my project refers to the original high quality file even though the sequence is set at 16 bit? Or is my 24 bit audio being modified to 16 bit when I drop it into the sequence?
    3. I guess the main question is: is it worth it for me to use 24 bit audio in my Premiere projects?
    Thank you for the help.
    Avery

    Hi,
    When working with *24bits in a *32 bits floating-point internal environment you have *8 extra bits (these are *wordlengths and have nothing to do with the sample frequency as stated above!) and gives you virtually a endless headroom ( even above 0 db on individual channels).
    But at the end (after the master and out of your soundcard that is ***16 or 24 bits) the wordlength gets changed (shortened from 32 to 24 or *** 16 bits)  and the sample frequency sampled down eventually as well,  the master output has to stay a *little under 0 db *depending of the type of sound.
    To answer your question: "It makes perfect sense to work with larger wordlenghts, because no matter you go down to 16 bits at the end, you have a much better sound quality and bigger headroom during mixing and at the end even when it's downsized  to 16 bits."
    ***16 bits in Premiere Pro
    David

  • Using MIDI cable with M-Audio FastTrack  Pro

    I have 2 keyboards. One has USB MIDI, so I just plug it directly in to my computer and Logic sees it. I also have a nicer keyboard (weighted keys), but this one doesn't have a USB out. It has a 1/4" jack and a 5 pin MIDI jack. I've tried plugging it into my FastTrack Pro using a MIDI cable, but it doesn't seem to work. What am I missing?
    Thanks

    Hi !
    Still no answer from M-Audio but it seems that they are not in cause.
    I read on several topics of Apple's Forums some similar problems with other audio devices and also with some USBhubs.
    I ran some little tests and for my case, using the other USB port of the MacBook seems to resolve the problem (but that's not a permanent solution for my point of view).
    Using a selft-powered USBhub works also, even on the port that makes it crash without hub.
    As I studied a little bit of electronics, it looks really like a problem of power supply through USB to me. It could be some kind of micro-cuts (or micro-undervoltage) that are sufficient to cut the audio stream and freeze a bit the system but not enough for MacOSX to switch significantly to the internal audio.
    But two questions still remain :
    Why one USB port of the MacBook and not the other one ?
    Why since 10.5.2 ?
    Steve, if you hear me ;o)
    'Hope they will react quickly !

  • HT204388 8 channel 24-bit audio at 192kHz on my mac mini (HDMI)

    when I use 8 channel 24-bit audio at 192kHz on my mac mini with denon 1910 I can't get sound from central speaker. What's the problem?

    when I use 8 channel 24-bit audio at 192kHz on my mac mini with denon 1910 I can't get sound from central speaker. What's the problem?

  • Mxf with 8 audio channels

    Hey guys,
    I`m editing a TV-Spot with Premiere CS6 and have to export it as a MXF OP1a (SMPTE 378M) (suffix .mxf) with 8 audio channels.
    When exporting it with Pr the mxf has only two audio channels (I have re-imported it into Pr for checking the channels)
    How do I get an mxf with 8 audio channels?
    I`m a bit stranded as I`ve to finish it until tomorrow....
    (video signal compliance: ITU-R BT.709)
    Thanks so far!

    Go to the Audio tab on the Export Settings dialog.  There you can select the number of channels in the MXF export.

  • 32 bit audio unit bridge unexpectingly quits

    I've just updated to Snow Leopard and I've been using Melodyne to fix vocals. When I used Melodyne on the first 3 vocals, everything in Logic was functioning fine but when I try to import the last vocal track into Melodyne, the 32 bit audio unit bridge unexpectingly quits. I've tried quiting and re-opening Logic and the same problem happens at the same spot. On the previous 3 vocal tracks that I fixed with Melodyne, I have already bounced those tracks in place and have got rid of the old tracks. So, the Melodyne plug in is only open on the last vocal track. It seems strange that my Melodyne plug in was working fine with the 32 bit audio unit bridge (as are all of my plug ins) until now.
    Any advice anyone?

    If you are running Logic in 64-bit mode with a variety of plugins, you're going to have to realise that things probably won't be stable until updates get released.
    The AU bridge is a workaround for the transition period, and one that many third-party developers haven't had much of an opportunity to test with their products, so you may well get funky behaviour in certain things.
    If you're really stuck, go back to 32-bit mode for your edits, and it's worth contacting the developer of your plugins to see what they say about AU Bridge and 64-bit compatibility.

  • Working with multiple audio tracks

    Hello,
    I'm working with video clips that have a stereo audio track (guide audio fed into the camera) synch'ed to 4 mono tracks (recorded from a variety of boom mics and lavaliers).
    Although I've linked all the audio clips to the video, it still gets a bit cumbersome when performing T or L cuts. When I hold down the Option key, I still have to adjust each of the audio track separately.
    Is there a more efficient way to deal with multiple audio tracks? Maybe some way to treat these audio tracks as one unit?
    BTW I'm working in FCP 7.
    Thanks,
    Thien

    One way:
    Lock the video track.
    Use the Edit Selection Tool to Select the audio transition points
    This will automatically open the Trim window, where you can move the cut point - in this case I am moving the audio cut(s) 30 frames later than the video cut:
    which gives me the displacement of all the tracks that I wanted:
    You can use this quite quickly once you get used to it.
    MtD

  • I make videos using my go pro hd camera, but when i export it only half of my 3 min video shows up with the audio playing in the background, plus when i try to select the quality in the export options it won't let me select 720p or 1080p?????? help!!!

    i make videos using my go pro hd camera, but when i export it only half of my 3 min video shows up with the audio playing in the background, plus when i try to select the quality in the export options it won't let me select 720p or 1080p?????? help!!!

    What you could do now is break up your video into smaller parts and render them out, then assemble them again as a whole.
    I know this is not the best fix, but it might work.
    You can duplicate an edit in the main screen, then delete the last bits and export,
    do the same for the other half.
    Then import the two bits (or more if you need) in a new edit.
    Out of curiosity, can you post what format the video is in?
    Copy a video straight from the camera to your computer.
    Open it in Quicktime player, and with out playing type Apple + i
    or Control + i for PCs
    It should tell you lots of info about the video, and might help us to see what is wrong.
    This is what it looks like:

  • Antares aVOX vocal harmonizer crashes the 32 bit audio bridge, any suggestions?

    Antares Vocal Harmonizer crashes the 32 bit audio brigde, intermittently on some Logic songs, But ALWAYS on one song in particular.  Any suggestions from anyone?

    If you are running Logic in 64-bit mode with a variety of plugins, you're going to have to realise that things probably won't be stable until updates get released.
    The AU bridge is a workaround for the transition period, and one that many third-party developers haven't had much of an opportunity to test with their products, so you may well get funky behaviour in certain things.
    If you're really stuck, go back to 32-bit mode for your edits, and it's worth contacting the developer of your plugins to see what they say about AU Bridge and 64-bit compatibility.

  • Problems with M-Audio Fasttrack Pro and Garageband after 10.5.2

    Hi all,
    I use GarageBand daily with my M-Audio FastTrack Pro and have had absolutely no problems until I installed the 10.5.2 update.
    Suddenly the Audio randomly cuts out when I'm recording, monitoring or playing back - also my recordings appear to skip and jump too. Usually I can rectify it by power cycling the Fasttrack but the problem re-occurs after about 30 seconds of recording.
    I have double checked the I am using M-Audio's latest drivers and have repaired permissions and the disk. I was wondering if anyone else had had any problems with this?
    All help would be appreciated, looks like I'm going back to 10.5.1 though.

    Hi !
    Still no answer from M-Audio but it seems that they are not in cause.
    I read on several topics of Apple's Forums some similar problems with other audio devices and also with some USBhubs.
    I ran some little tests and for my case, using the other USB port of the MacBook seems to resolve the problem (but that's not a permanent solution for my point of view).
    Using a selft-powered USBhub works also, even on the port that makes it crash without hub.
    As I studied a little bit of electronics, it looks really like a problem of power supply through USB to me. It could be some kind of micro-cuts (or micro-undervoltage) that are sufficient to cut the audio stream and freeze a bit the system but not enough for MacOSX to switch significantly to the internal audio.
    But two questions still remain :
    Why one USB port of the MacBook and not the other one ?
    Why since 10.5.2 ?
    Steve, if you hear me ;o)
    'Hope they will react quickly !

  • 24-bit audio processing?

    Can G4 Quicksilvers process 24-bit audio?
    I currently run a MBox to run audio into Pro Tools LE on my machine and I am wondering if it can work properly with a 24-bit session. Thanks!

    Can G4 Quicksilvers process 24-bit audio?
    I currently run a MBox to run audio into Pro Tools LE on my machine and I am wondering if it can work properly with a 24-bit session. Thanks!

Maybe you are looking for