Reverse playback of Raw-Audio

All your problems with Audio, Video and Images.

Reverse playback of Raw-Audio

Postby 8200 » Tue Nov 08, 2011 9:04 am

Hi guys,



I have got a little raw audio player - just for testing my raw recorder (16bit pcm).

The player is working fine but it plays reverse.
So I thought the easiest way for correcting this is just to re-order the byte array. But in my solution there is a litte bug - because it sounds noisy.


song .... the old byte array
songr .... the new re-orderd byte array

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. byte[] songr = new byte[song.length];
  2.                 for (int i=0, j=song.length - 16; i<j; i=i+16, j=j-16){
  3.                         for (int k=i, l=j; k<i+16; k++, l++) songr[k]=song[l];
  4.                         }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4



Thank you for your help!!

Regards,
Arthur
8200
Freshman
Freshman
 
Posts: 2
Joined: Fri Nov 04, 2011 10:34 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 8 guests