You are not logged in.

#1 2017-02-05 23:20:15

audioMan
Member
Registered: 2017-02-05
Posts: 16

[Solved] Bash Script to Automate Audio Conversion and CD Writing

Hi,

I am currently trying to create a script to automate converting 96/24 FLAC files to 44/16 wav files and writing the converted files to an audio CD using CDRDAO. The conversion script works fine. However, in order to use CDRDAO a .toc file must be generated. If I could only figure out how to generate the .toc file without using a program such as Ardour (what I am trying to avoid) then the script would be great.

Here is what I have so far:

#!/bin/bash

echo "Please be sure that you are in the directory that contians the flac files you would like to convert as well as this script"

# Creates the directories needed
mkdir converted


# Converts from FLAC to WAV
flac -d *flac wav
mv *wav converted
cd converted

echo "Flac conversion completed."

# Uses sOx to convert from 96/24 to 44/16 
sox *wav -b 16 -r 44.1k output.wav dither -f shibata 
echo "sOx conversion completed."


# Records the converted audiofiles to a CD using CDRDAO.
	
# What to do here? 

Obviously there needs to be a method to generate the .toc file for CDRDAO. If anyone can help with this then it would be greatly appreciated!

- audioMan

Last edited by audioMan (2017-02-06 00:53:31)

Offline

#2 2017-02-05 23:43:43

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

Maybe mktoc? I don't know anything about it, but seems it does what you are looking for.

AUR: https://aur.archlinux.org/packages/mktoc/
GitHub: https://github.com/cmcginty/mktoc

Last edited by mis (2017-02-05 23:44:05)

Offline

#3 2017-02-05 23:49:28

audioMan
Member
Registered: 2017-02-05
Posts: 16

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

mis wrote:

Maybe mktoc? I don't know anything about it, but seems it does what you are looking for.

AUR: https://aur.archlinux.org/packages/mktoc/
GitHub: https://github.com/cmcginty/mktoc


Thanks! I will look into it and let you know how it works.

- audioMan

Offline

#4 2017-02-05 23:54:26

audioMan
Member
Registered: 2017-02-05
Posts: 16

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

mis wrote:

Maybe mktoc? I don't know anything about it, but seems it does what you are looking for.

AUR: https://aur.archlinux.org/packages/mktoc/
GitHub: https://github.com/cmcginty/mktoc

This is the output of makepkg:

==> Making package: mktoc 1.3-1 (Sun Feb  5 18:50:11 EST 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading mktoc-1.3.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   143  100   143    0     0    487      0 --:--:-- --:--:-- --:--:--   489
100 25309  100 25309    0     0  45213      0 --:--:-- --:--:-- --:--:-- 45213
==> Validating source files with md5sums...
    mktoc-1.3.tar.gz ... Passed
==> Extracting sources...
  -> Extracting mktoc-1.3.tar.gz with bsdtar
==> Entering fakeroot environment...
==> Starting package()...
Traceback (most recent call last):
  File "setup.py", line 14, in <module>
    from setuptools import setup
ImportError: No module named setuptools
==> ERROR: A failure occurred in package().
    Aborting...
 

Any input on the error?

- audioMan

Offline

#5 2017-02-05 23:58:33

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

audioMan wrote:

Any input on the error?

Did you try a web search for "ImportError: No module named setuptools"?

Offline

#6 2017-02-06 00:11:59

audioMan
Member
Registered: 2017-02-05
Posts: 16

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

2ManyDogs wrote:
audioMan wrote:

Any input on the error?

Did you try a web search for "ImportError: No module named setuptools"?

Yes, I did. I also tried installing the pypy-packaging package, but ironically a dependency for it is the setup-tools, which require pypy-packaging. Doesn't make any sense.

- audioMan

Offline

#7 2017-02-06 00:26:10

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

After adding following make dependencies to the PKGBUILD, it builds in a chroot for me.

makedepends=('python2-setuptools' 'python2-chardet')

I'm not sure if python2-chardet is only a make dependency or also needed at runtime..

Last edited by mis (2017-02-06 00:26:32)

Offline

#8 2017-02-06 00:38:11

audioMan
Member
Registered: 2017-02-05
Posts: 16

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

mis wrote:

After adding following make dependencies to the PKGBUILD, it builds in a chroot for me.

makedepends=('python2-setuptools' 'python2-chardet')

I'm not sure if python2-chardet is only a make dependency or also needed at runtime..

Forgive my naivety, but how do I add the make dependencies to the PKGBUILD? This is my first Arch install. The wiki on makedepends didn't seem to offer much.

Regards,

- audioMan

Last edited by audioMan (2017-02-06 00:39:00)

Offline

#9 2017-02-06 00:42:43

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

audioMan wrote:

Forgive my naivety, but how do I add the make dependencies to the PKGBUILD? This is my first Arch install. The wiki on makedepends didn't seem to offer much.

Just edit the PKGBUILD file and add those dependencies (add the line mis gave you). Or you could just install the python2-setuptools and python2-chardet packages, build mktoc, and remove the packages if you think you won't need to build again.

I asked if you did a web search, because I did and one of the first hits in my search pointed me to installing the python *-setuptools packages.

Last edited by 2ManyDogs (2017-02-06 00:45:39)

Offline

#10 2017-02-06 00:46:49

audioMan
Member
Registered: 2017-02-05
Posts: 16

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

2ManyDogs wrote:
audioMan wrote:

Forgive my naivety, but how do I add the make dependencies to the PKGBUILD? This is my first Arch install. The wiki on makedepends didn't seem to offer much.

Just edit the PKGBUILD file and add those dependencies (add the line mis gave you). Or you could just install the python2-setuptools and python2-chardet packages, build mktoc, and remove the packages if you think you won't need to build again.

I asked if you did a web search, because I did and one of the first hits in my search pointed me to installing the python *-setuptools packages.


That worked. Thanks.

- audioMan

Offline

#11 2017-02-06 00:48:36

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

You're welcome. Please mark your thread [SOLVED] (edit the title of your first post.)

Offline

#12 2017-02-06 13:00:17

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [Solved] Bash Script to Automate Audio Conversion and CD Writing

Update: python2-setuptools and python2-chardet are both runtime dependencies.

Offline

Board footer

Powered by FluxBB