Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

Converting Audio Streams



This guide will describe how to convert audio streams. You may want to record a WEB based radio station. In order to do that just follow the following steps:

  1. Record the stream - mplayer -dumpstream mms://s67wm.castup.net/990310001-52.wmv
  2. Convert the output wmv string to wav - mplayer stream.dump -ao pcm:file=1.wav
  3. convert the wav to mp3 - lame -h -b 192 1.wav 1.mp3
  4. Editing The MP3 File
    Once you got your MP3 audio file, you may want to extract some songs or to remove some data. It might be a song, which you don't like or any other part of the MP3 file.

  5. Play the MP3, listen to it and write down the time of the parts you want to extract : starting time and ending time per each one. Also note the entire time of all the MP3 - you'll need it later.
  6. On my system the output of the player looks like what is shown below:
    The total time is 3*60 + 11 seconds. The starting point is at 60+8 seconds. In a similar way you find the ending point.
  7. And now for the perl script, which does the extraction.

  8. First run it without start and end points, just to get the entire MP3 time.
    perl mp3_pr.pl CharlesAznavourIlFautSavoir.mp3 ex_CharlesAznavourIlFautSavoir.mp3
  9. When the program finishes, it also displays the total number of frames:
    frame count=7950.
  10. So now you know that 198 seconds (3:11) is 7950 frames. The starting point is (68:198)*7950=~2730. Suppose you calculate the end point to be 5000 (frames).
  11. Now re-invoke the perl script, this time with the parameters of start and end points:perl mp3_pr.pl CharlesAznavourIlFautSavoir.mp3 ex_CharlesAznavourIlFautSavoir.mp3 2730 5000
  12. This time expect ex_CharleAznavourIlFautSavoir.mp3 to be the extraction you wished to get.
  13. Playing CharlesAznavourIlFautSavoir.mp3.
    Audio file file format detected.
    ==========================================================================
    Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
    mpg123: Can't rewind stream by 1203 bits!
    AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400)
    Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
    ==========================================================================
    alsa-init: using device default
    alsa: 44100 Hz/2 channels/4 bpf/65536 bytes buffer/Signed 16 bit Little Endian
    AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
    Video: no video
    Starting playback...
    A: 68.1 (01:08.0) of 191.0 (03:11.0) 3.3%



  14. perl script
  15. An Example of the editeded MP3

  16. You may want to share your thoughts and add your comments. Feedback This Site



Please let me know what you think on my site.

 


Contact me now at:

  ...


I would be happy to offer my services. Call ASAP !


Home

Download Area

standard TCP/IP stack based on a free code from University of Queensland






Search This Site




new pages on this site