Madplay "bites off the last word"

Alleycat
 
Posts: 7
Joined: Wed Mar 08, 2017 3:41 am

Madplay "bites off the last word"

Thu Apr 06, 2017 2:29 am

I been trying plenty of stuff, im trying to use the cube as a "voice server" to speak certain sentences or make sentences up from words stored as mp3 on an inserted sd card now, thing is
mp3s that dont have one or two seconds of silence are like "bitten off" at the end, for example :

Code: Select all
root@fuckpencilpushingnazis:/mnt/mmcblk0p1# madplay 4-320.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
         Artist: http://www.acapela-group.com/ -  Valeria
51 frames decoded (0:00:01.3), -5.8 dB peak amplitude, 0 clipped samples
root@fuckpencilpushingnazis:/mnt/mmcblk0p1# madplay 4-320.mp3 0-320.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
>> 4-320.mp3
         Artist: http://www.acapela-group.com/ -  Valeria
51 frames decoded (0:00:01.3), -5.8 dB peak amplitude, 0 clipped samples
>> 0-320.mp3
         Artist: http://www.acapela-group.com/ -  Valeria
8 frames decoded (0:00:00.2), -44.3 dB peak amplitude, 0 clipped samples
root@fuckpencilpushingnazis:/mnt/mmcblk0p1# madplay 4-320.mp3 0-320.mp3 0-320.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
>> 4-320.mp3
         Artist: http://www.acapela-group.com/ -  Valeria
51 frames decoded (0:00:01.3), -5.8 dB peak amplitude, 0 clipped samples
>> 0-320.mp3
         Artist: http://www.acapela-group.com/ -  Valeria
8 frames decoded (0:00:00.2), -44.3 dB peak amplitude, 0 clipped samples
>> 0-320.mp3
         Artist: http://www.acapela-group.com/ -  Valeria
8 frames decoded (0:00:00.2), -44.3 dB peak amplitude, 0 clipped samples
root@fuckpencilpushingnazis:/mnt/mmcblk0p1#
</PRE>
gives something like <br>
<ul>
<li>did you close the doh</li>
<li>did you close the dor</li>
<li>did you close the door</li>
</ul>


where 0-320.mp3 is a completely empty mp3, i got some other comparisons, and a lot of rabble which i keep on my homeblog here : http://www.alleycat.be/tulz/re-pliables/contents/howto.php?include=14

leads me to believe that for some reason the audio device is closed too soon, since it plays a sample that goes "did you bar the door" which has like a full second of zero sound at the end where as the other one "did you close the door" loses the last word

playing mp3s in a list plays all mp3s complete except the last one. I dont want to use "whitespace" mp3s b/c this would use more resources than needed and prefer not to record the samples with whitespace at the end (pardon the jargon) to save space on the sd card which has 64mb only and because its more elegant to do so.

also any .wav or .aiff i convert with audacity it wont play so , technically i could fix it by recording all sentences with a full second of silence at the end but i dont know how this would affect "constructed sentences" like for instance to speak a report on the day dates and numbers would be made out of chunks or words.

If anyone can think of any solution to make an mp3 play completely without using tricks and hackarounds id be much obliged, maybe im simply missing something or maybe madplay wasnt built for this ?

Any advice welcome i cant find any other package to replace madplay with either so far if thats a solution but it would have to be as lightweight as possible

thanks in advance i hope my explanation was not too confusing lol

Alleycat
 
Posts: 7
Joined: Wed Mar 08, 2017 3:41 am

Re: Madplay "bites off the last word"

Sun Apr 09, 2017 10:52 pm

Right, i'll answer me myself ... supposing madplay has an issue with mp3s that are too short in the way its coded and im not really down with C (yet) i figured something out. After all its about how to make the most of a micromachine with as less space as possible, (well for me in this case)

Code: Select all
#!/bin/bash
file="speechline"

cat $file | while read line
do
    echo "Processing new line" >/dev/tty
    for word in $line
    do
        aplay $word
    done
done


as well as
Code: Select all
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# ls
bar.wav        did.wav        door.wav       speaktext.sh0  the.wav        you.wav
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# mv bar.wav bar
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# mv did.wav did
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# mv door.wav door
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# mv you.wav you
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# ls
bar            did            door           speaktext.sh0  the.wav        you
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# mv the.wav the
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# cat speaktext.sh0
#!/bin/bash

file="$HOME/COMMON/minimalMel/speechline"

cat $file | while read line
do
    echo "Processing new line" >/dev/tty
    for word in $line
    do
        espeak $word
    done
done
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# ls
bar            did            door           speaktext.sh0  the            you
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# ls -al
drwxrwxrwx    2 root     root          4096 Apr  9 22:28 .
drwxrwxrwx    4 root     root         16384 Apr  9 22:26 ..
-rwxrwxrwx    1 root     root         33524 Apr  8 03:06 bar
-rwxrwxrwx    1 root     root         33680 Apr  8 03:06 did
-rwxrwxrwx    1 root     root         66984 Apr  8 03:06 door
-rwxrwxrwx    1 root     root           167 Apr  9 22:29 speaktext.sh0
-rwxrwxrwx    1 root     root         26240 Apr  8 03:06 the
-rwxrwxrwx    1 root     root         25620 Apr  8 03:06 you
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# ./speaktext.sh0
-ash: ./speaktext.sh0: not found
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# speaktext.sh0
-ash: speaktext.sh0: not found
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# .speaktext.sh0
-ash: .speaktext.sh0: not found
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# ash speaktext.sh0
cat: can't open 'speechline': No such file or directory
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# echo "did you bar the door" > speechl
ine
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup# ash speaktext.sh0
Processing new line
Playing WAVE 'did' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Playing WAVE 'you' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Playing WAVE 'bar' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Playing WAVE 'the' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Playing WAVE 'door' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
root@fuckpencilpushingnazis:/mnt/mmcblk0p1/cutup#


gives me actually what i wanted, its choppy as hell and no intonation ofcourse but a lot more sexy than espeak and if i ever get to where it all connects and runs together from motiondetected events to speechcommands to my "compad" (an old pocketbook iq i had no more use for) and i get into C maybe i can figure out some aplay-clone that gives simple pitch and timestretching + pause for intonations (far away)
anyway

if anyone still feels like explaining how exactly it is that madplay wont play short mp3s completely im always eager to understand but with this i can probably get all the words i need on the 64mb sd card <b>plus</b> the scripts i need it to run

vonger, my man, its the best thing since i had my c64 and power cartridge

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 41 guests