Many music CD image files contain cue-format track separation files. In UbuntuLinux, you can use some tools to achieve automatic track separation. 1. The tools to be installed in Ubuntu include flac, shntool $ sudoapt-getinstall1_shntool. If you want to directly track ape, you need the mac codecs for linux, compile and install them; or, first, convert the ape file to wav or falc format. Ii. flac segmentation for cue indexes:
Many music CD image files contain cue-format track separation files. In Ubuntu Linux, you can use some tools to achieve automatic track separation.
1. Tools to be installed in Ubuntu include flac and shntool.
$ Sudo apt-get install flac shntool
To directly split ape rails, you must compile and install mac codecs for linux. Alternatively, you must first convert the ape file to wav or falc format.
Ii. flac segmentation for cue indexes:
$ Shntool split-t "% n. % p-% t"-f example. cue-o flac music.flac-d outputdir
-D specifies the output directory of the falc file after the track separation. If not specified, it is generated in the current directory.
-T specifies the file name format of the output file. % n indicates the audio track number, % p indicates the player/artist, and % t indicates the title.
Similar to ape track Separation
$ Shntool split-t "% n. % p-% t"-f example. cue-o ape example. ape-d outputdir
At present, it seems that an error cannot be processed when ape is divided into multiple ape, but the ape is then transcoded to another format (flac, mp3 ...) There is no problem. There is no problem between flac and other formats.
The character set of the cue file should be the same as the character set currently used by the system. Otherwise, it is better to use iconv for transcoding. Otherwise, the generated file name may be garbled.
$ Iconv-f gb18030-t utf8 CDImage. cue-o CDImage-linux.cue
$ Dos2unix CDImage-linux.cue.
3. Convert ape to wav or flac format
$ Avconv-I CDImage. ape CDImage.flac/ape -----> flac. Previously, ffmpeg was used, and now avconv is used.
$ Avconv-I CDImage.wav CDImage.flac // wav -----> flac
$ Avconv-I CDImage. ape CDImage.wav // ape ----> wav
Iv. Conversion of other formats
$ Flac CDImage.wav CDImage.flac // wav ----> flac
$ Shnconv-I ape-o flac CDImage. ape // ape -----> flac
$ Shnconv-I flac-o ape CDImage.flac // flac -----> ape
V. Script audio-cue-split.sh
#/Bin/bash
If [$ #-ne 2]
Then
Echo-e "Usage: audio-cue-split.sh [AUDIO_FILE_NAME] [DECODE_MODULE]"
Echo "example: audio-cue-split.sh CDImage.wav"
Echo "Note: The cue file must has the same name with the audio file ."
Echo-e "Note: DECODE_MODULE: wav, flac, etc"
Exit
Fi
AUDIO_FILE = $1
DECODE_MODULE = $2
FILE_PREFIX = 'echo $ AUDIO_FILE | sed "s/. $ DECODE_MODULE $ //"'
If ["$ DECODE_MODULE" = "ape"]
Then
Echo-e "First, convert ape format to flac format, waite a minute ..."
Pai_file1_1_file_prefix.flac
# Ffmpeg-I "$ AUDIO_FILE" "$ pai_file"
Avconv-I "$ AUDIO_FILE" "$ pai_file"
AUDIO_FILE = $ pai_file
DECODE_MODULE = 'flac'
CONVERT = "true"
Fi
CUE_FILE = $ FILE_PREFIX.cue
CUE_FILE_LINUX =$ FILE_PREFIX-linux.cue
# Echo AUDIO_FILE = $ AUDIO_FILE
# Echo DECODE_MODULE = $ DECODE_MODULE
# Echo FILE_PREFIX = $ FILE_PREFIX
# Echo CUE_FILE = $ CUE_FILE
Iconv-f gb18030-t utf8 "$ CUE_FILE"-o "$ CUE_FILE_LINUX"
Dos2unix "$ CUE_FILE_LINUX"
Shntool split-t "% n-% t"-f "$ CUE_FILE_LINUX"-o $ DECODE_MODULE "$ AUDIO_FILE"
If ["$ CONVERT" = "true"-a "$ __file "! = ""]
Then
Echo-e "Remove temporary flac file: $ pai_file"
Rm-f "$ pai_file"
Fi
Note: The above script is successfully tested in Ubuntu Kylin 14.04.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-06/118791.htm