pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: PDActionSound Issues
Date Sat, 09 Jul 2016 13:36:58 GMT
Thanks, done.

Tilman

Am 09.07.2016 um 15:22 schrieb Gilad Denneboom:
> I had to play a bit with the settings to get working correctly with my
> 8-bit clips.
> This is the code I ended up using:
>
>      private static InputStream getAudioStream(String filename) throws
> Exception {
>          File file = new File(filename);
>          AudioInputStream in = AudioSystem.getAudioInputStream(file);
>          AudioFormat baseFormat = in.getFormat();
>          AudioFormat decodedFormat = new AudioFormat(
>              AudioFormat.Encoding.PCM_UNSIGNED,
>              baseFormat.getSampleRate(),
>              baseFormat.getSampleSizeInBits(),
>              baseFormat.getChannels(),
>              baseFormat.getChannels(),
>              baseFormat.getSampleRate(),
>              false);
>          return AudioSystem.getAudioInputStream(decodedFormat, in);
>      }
>
> Feel free to post it as a follow-up to your SO reply (I don't have enough
> "reputation" there to do so myself, I'm afraid).



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message