DBaldock9
Headphoneus Supremus
Here’s my latest experience with my Zishan DSD.
Foolishly, it took me ages to realise I had been sold the CS43198 version!
So ignore my posts about the Dual AK4497 version!
The CS43198 version is the one I experienced all the difficulty with FLAC files playing out of sequence in folders at the beginning of the sort order. (By the way, the CS43198 version is pretty good, though I’ll be in the market for the Dual AK4499 version when AK sort out their production costs).
I appealed to NiceHK to query Zishan about the problem, and was told: Don’t use FLAC. Great, thanks Zishan!
So stubbornly I carried through my project of writing a bash script to collect all folders containing multiple FLAC files into CUE file controlled single joined FLAC files. Wow, that was a labour!!! - because my FLAC files are buried quite deeply: /<composer>/<work>/<work_number>/<performer>
And it worked almost perfectly! Considering I couldn’t find anything to produce a CUE sheet programmatically except shntool (sox faired no better) which only generates the track start times - and NOTHING else, I had to use intensive logic to generate track titles on the fly. It took me ages.
Now my whole library consists of these programmatically generated CUE sheets and joined up FLAC file.
I say it worked ALMOST perfectly, because some of these CUE files don’t find the correct end time, showing a ridiculously high end time of 5+ hours. But some are correct. Why??? Do any of you smart people know?
Still, I’m in better shape now. I just have endure the bad CUE files jumping off deep into my sd card at the end of playing the FLAC. But at least it plays the FLAC through, stopping at the end.
If anyone wants to experiment with my bash script I could send it to you.
I've never created CUE Sheets, but I have used exiftool in a bash script, to read the meta-data in FLAC files, and create M3U Playlists.
The exiftool arguments I use to get the track time is - exiftool -s3 -Duration
NOTE: This was written on a Windows 7 PC, and run within the cygwin environment. I don't think I've tried running it directly, after switching back to Linux.
Bash:
#!/bin/bash
###########################################
# NAME: create-playlist-1.sh
# AUTHOR: David Baldock
# DATE CREATED: 01-JUL-17
# DATE MODIFIED: -
# DESCRIPTION: A script to create a M3U playlist file.
#
# Run it from within the Playlist folder,
#+ in this folder structure -
#+ Music/
#+ Music/Playlists/[PlaylistFileName.m3u]
#+ Music/[genre]/[artist]/[album]/[tracks]
#+
#+ - using input from this command -
#+ find -O2 ../[genre]/[artist]/ -name "*.flac" | sort | create-playlist-1.sh >
#+ [PlaylistFileName.m3u]
#
# The output is a file containing two lines for each track -
#+ #EXTINF:[TrackTotalSeconds],[ArtistName] - [SongTitle]
#+ [TrackName]
#
# The following sort command can be used to combine files from
#+ multiple different folder structures -
#+ sort -t / -k 4.1
#
###########################################
main() {
#####
# main() function
#####
echo "#EXTM3U"
while read TrackName
do
TrackTotalSeconds=0
TrackDuration=$(exiftool -s3 -Duration "${TrackName}" | tr -d '\r')
FinalCharacter=$(echo ${TrackDuration: -1})
## Does TrackDuration end with "s"?
## If so, then it's less than 1 minute, and it's processed
##+ differently than if it's more than 1 minute.
if [ ${FinalCharacter} == "s" ]; then
TrackSeconds=$(echo ${TrackDuration} | cut -d" " -f1)
TrackSeconds=$(echo "${TrackSeconds#"${TrackSeconds%%[!0]*}"}")
TrackSeconds=$(printf "%.0f\n" ${TrackSeconds})
TrackSeconds_Seconds=$(( TrackSeconds * 1 ))
else
## If TrackDuration doesn't end with "s",
##+ then it's more than 1 minute, and we process the time,
##+ to convert the Hours:Minutes:Seconds to seconds.
TrackHours=$(echo ${TrackDuration} | cut -d":" -f1)
TrackHours_Seconds=$(( TrackHours * 3600 ))
TrackTotalSeconds=$(( TrackTotalSeconds += TrackHours_Seconds ))
TrackMinutes=$(echo ${TrackDuration} | cut -d":" -f2)
TrackMinutes=$(echo "${TrackMinutes#"${TrackMinutes%%[!0]*}"}")
TrackMinutes_Seconds=$(( TrackMinutes * 60 ))
TrackTotalSeconds=$(( TrackTotalSeconds += TrackMinutes_Seconds ))
TrackSeconds=$(echo ${TrackDuration} | cut -d":" -f3)
TrackSeconds=$(echo "${TrackSeconds#"${TrackSeconds%%[!0]*}"}")
TrackSeconds_Seconds=$(( TrackSeconds * 1 ))
fi
TrackTotalSeconds=$(( TrackTotalSeconds += TrackSeconds_Seconds ))
ArtistName=$(echo $TrackName | cut -d'[' -f2)
ArtistName=$(echo $ArtistName | cut -d']' -f1)
SongTitle=$(echo $TrackName | cut -d'[' -f1)
SongTitle=$(echo $SongTitle | cut -d'/' -f5)
SongTitle=$(echo $SongTitle | cut -c6-)
echo "#EXTINF:"${TrackTotalSeconds}","${ArtistName}" - "${SongTitle}
echo ${TrackName}
done
exit 0
}
#####
# Call main() function
#####
main "$@"
Last edited: