Re: [Flashcoders] modify sample rate in MP3 header?

2006-07-21 Thread Jeff Stearns

This is impossible.

MP3 audio is grouped into frames.  Each frame contains 23 mSec of  
audio data (and thus all MP3 files play at approximately 38 frames/ 
second).


If the MP3 is encoded at a high bit rate, each frame is large.  If  
it's encoded at a low bit rate, the frames are small.  But they  
always contain 23 mSec of audio.


Furthermore, the meaning of the data bytes in each frame depend on  
the values in the frame header.  If you change the header, the MP3  
decoder won't have a clue how to decode the data in the frame.  It  
will fail miserably.


You can change values in the header, but that will just cause the MP3  
decoder to fail.  It won't change the fact that each frame contains  
23 mSec of audio.


There are some techniques that will slow down audio to half or  
quarter speed, but you have to do them downstream of the MP3  
decoder.  You can clock the audio driver at half or quarter speed, or  
you can duplicate every sample of decoded audio by a factor of 2 or  
4.  But you can't do these things in Flash because you can't get your  
hands on the decoded audio stream or the audio driver configuration.


-jeff stearns

On Jul 20, 2006, at 1:05 PM, Marc Hoffman wrote:

I've been using Flash to play back bird songs from amy website. By  
generating some MP3's at half or quarter speed (with commensurate  
drop in pitch) I can demonstrate some fascinating detail in bird  
songs that's otherwise missed by the human ear.


Now if I could just modify the MP3 headers on-the-fly (with server  
side file manipulation), I could let Flash slow down any MP3's  
without having to generate and store separate versions of the sound  
file on the server.


Anybody know of tools to modify MP3 header info on the fly? Sort of  
like creating thumbnails of images using PHP?


Marc Hoffman

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] modify sample rate in MP3 header?

2006-07-20 Thread Bernard Visscher
I don't believe it's possible like that.
MP3 doesn't store samplerate in the headers it's all over the place.
Just test with a simple mp3, delete the first mb with a texteditor now it
will play the remaining mp3 with the correct sample rate.

Bernard 

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] Namens Marc Hoffman
 Verzonden: donderdag 20 juli 2006 22:06
 Aan: Flashcoders mailing list
 Onderwerp: [Flashcoders] modify sample rate in MP3 header?
 
 I've been using Flash to play back bird songs from amy 
 website. By generating some MP3's at half or quarter speed 
 (with commensurate drop in pitch) I can demonstrate some 
 fascinating detail in bird songs that's otherwise missed by 
 the human ear.
 
 Now if I could just modify the MP3 headers on-the-fly (with 
 server side file manipulation), I could let Flash slow down 
 any MP3's without having to generate and store separate 
 versions of the sound file on the server.
 
 Anybody know of tools to modify MP3 header info on the fly? 
 Sort of like creating thumbnails of images using PHP?
 
 Marc Hoffman
 
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training 
 http://www.figleaf.com http://training.figleaf.com
 

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com