Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-09-2020, 03:39 PM   #31
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by dnmmx View Post
Hi, a noob question, but are you using VoiceView to connect bluetooth headset or is there any other way ? With VoiceView I had to double click everything to select and it's not a good experience when you listen to mp3 audiobook and try to open the ebook page.
This extension does not use VoiceView in any manner. It takes advantage of the support provided for Audible books on the kt4 and pw4 to play other media that sox supports either on your Kindle or streamed over the internet. It can be used to play mp3 audiobooks by placing them in the music folder.

Dave
dhdurgee is online now   Reply With Quote
Old 05-09-2020, 04:08 PM   #32
arooni
Addict
arooni began at the beginning.
 
Posts: 315
Karma: 26
Join Date: Jul 2012
Device: Kindle Paperwhite 4 (2018)
Any plan of building an ability to resume an mp3 audiobook so I wouldn’t have to listen in one session ?
arooni is offline   Reply With Quote
Advert
Old 05-09-2020, 04:33 PM   #33
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by arooni View Post
Any plan of building an ability to resume an mp3 audiobook so I wouldn’t have to listen in one session ?
I can see the desire for this. I will have to check and see if sox can support this and then would have to determine how to accomplish it.

I assume you are stopping playback with the KUAL menu entry. If I can see a way for sox to support it, I guess I would need a separate "bookmark" menu entry and possibly a "resume" menu entry as well.

Dave
dhdurgee is online now   Reply With Quote
Old 05-09-2020, 04:48 PM   #34
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by dhdurgee View Post
Sox (and its play renamed/linked version) will work directly with alsa, so no need to pipe it there instead. As I don't have a pw3 I can't test things directly here and have to rely on feedback from you and others. So I would in particular like you to test the ./play command and see if it works or not. I would also be interested in the output of which alsa on your pw3, as I think that might allow me to detect if it is available for me to use.

Dave

:
Code:
[root@kindle sox]# cp sox play
[root@kindle sox]# ls
README.txt            menu.json             playurl.sh
config.xml            play                  sox
killgst.sh            playall.sh            soxi
killsox.sh            playfile.sh
library               playinternetradio.sh
[root@kindle sox]# LD_LIBRARY_PATH=./library ./play /mnt/us/music/Multitudes.mp3
./play FAIL sox: Sorry, there is no default audio device configured
[root@kindle sox]# LD_LIBRARY_PATH=./library ./play -V3 /mnt/us/music/Multitudes
.mp3
./play FAIL sox: Sorry, there is no default audio device configured
[root@kindle sox]# aplay --version
aplay: version 1.0.22 by Jaroslav Kysela <perex@perex.cz>
[root@kindle sox]#
PoP is offline   Reply With Quote
Old 05-09-2020, 05:01 PM   #35
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Try adding "-t alsa" to the end of that ./play command line after the file name and see if that works.

Dave

PS: if that doesn't work see if you can get aplay to play the file. If so I might be able to use it instead.

Last edited by dhdurgee; 05-09-2020 at 05:11 PM. Reason: add PS
dhdurgee is online now   Reply With Quote
Advert
Old 05-09-2020, 07:54 PM   #36
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by dhdurgee View Post
Try adding "-t alsa" to the end of that ./play command line after the file name and see if that works.

Code:
[root@kindle sox]# LD_LIBRARY_PATH=./library ./play -t alsa /mnt/us/music/Multitudes.mp3
./play FAIL sox: Sorry, there is no default audio device configured

[root@kindle sox]# LD_LIBRARY_PATH=./library ./play  /mnt/us/music/Multitudes.mp3 -t alsa
./play FAIL formats: no handler for given file type `alsa'
PS: if that doesn't work see if you can get aplay to play the file. If so I might be able to use it instead.

And it will only aplay a wav. It will aplay the mp3 binary (horribly sounding) as if it were a wav.
^inline
PoP is offline   Reply With Quote
Old 05-09-2020, 09:34 PM   #37
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Ok. Try this one:

LD_LIBRARY_PATH=./library ./sox /mnt/us/music/Multitudes.mp3 -t wav - -- | aplay

Dave
dhdurgee is online now   Reply With Quote
Old 05-10-2020, 06:04 AM   #38
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Plays as a charm.

Code:
[root@kindle root]# cd /mnt/us/extensions/sox
[root@kindle sox]# LD_LIBRARY_PATH=./library ./sox /mnt/us/music/Multitudes.mp3
-t wav - -- | aplay
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
[root@kindle sox]#
And Bob Dylan thanks you too:
Spoiler:
PoP is offline   Reply With Quote
Old 05-10-2020, 09:24 AM   #39
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Great! I will work up a revised script for you to test and post it here. If I code this properly the new script will support both Kindles with gstreamer sound and alsa sound.

Dave
dhdurgee is online now   Reply With Quote
Old 05-10-2020, 05:11 PM   #40
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Try this out, it works on my pw4.

Dave
Attached Files
File Type: zip playfile2.zip (733 Bytes, 279 views)
dhdurgee is online now   Reply With Quote
Old 05-10-2020, 08:12 PM   #41
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
With this small change works fine on the PW3:
Code:
#!/bin/sh
# script to play a local file on pw4

# add required library

export LD_LIBRARY_PATH=/mnt/us/extensions/sox/library:$LD_LIBRARY_PATH

# get soxi data from file to be played

/mnt/us/extensions/sox/soxi "$1" >/var/tmp/soxidata.txt

# now to parse necessary information

Chan=$(awk -F: '/Channels/ {gsub(" ","");print $2}' /var/tmp/soxidata.txt)

Wide=$(awk -F: '/Precision/ {gsub(" ","");gsub("-bit","");print $2}' /var/tmp/soxidata.txt)

Rate=$(awk -F: '/Sample Rate/ {gsub(" ","");print $2}' /var/tmp/soxidata.txt)

rm /var/tmp/soxidata.txt

# now determine how to play it

driver="unknown"

which aplay>/dev/null && driver="alsa"

which gst-launch>/dev/null && driver="gst"

# now start playing

case "$driver" in

     alsa)

     /mnt/us/extensions/sox/sox "$1" -t wav - -- |  aplay
     ;;

     gst)

     /mnt/us/extensions/sox/sox "$1" -t raw - -- |  /usr/bin/gst-launch \
     filesrc location=/dev/stdin \
     ! audio/x-raw-int, \
        endianness='(int)'1234, \
        signed='(boolean)'true, \
        width='(int)'$Wide, \
        depth='(int)'$Wide, \
        rate='(int)'$Rate, \
        channels='(int)'$Chan \
     ! queue \
     ! mixersink&
     ;;

     *)

     echo "Unknown sound driver, cannot play media."
     ;;
esac
PoP is offline   Reply With Quote
Old 05-10-2020, 09:05 PM   #42
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
Ugh. Missed that change when I copy/pasted the sox part. Glad you were able to spot it. Now that the concept is proven I can adapt the existing scripts and release with pw3 support as well. Thank you for your assistance in testing this out.

Dave
dhdurgee is online now   Reply With Quote
Old 05-11-2020, 11:07 AM   #43
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
I have tweaked the script a bit more giving priority to ALSA if available, which required dealing with the case of ALSA being present but not usable. I have attached the modified script and would appreciate confirmation that I didn't break ALSA support for you.

Dave
Attached Files
File Type: zip playfile2.zip (984 Bytes, 180 views)
dhdurgee is online now   Reply With Quote
Old 05-11-2020, 01:15 PM   #44
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Nothing broken, I can still play Dylan
Code:
[root@kindle root]# cd /mnt/us/extensions/sox
[root@kindle sox]# ./playfile2.sh /mnt/us/music/Multitudes.mp3
Playing via ALSA.
Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
[root@kindle sox]#
PoP is offline   Reply With Quote
Old 05-11-2020, 04:34 PM   #45
dhdurgee
Guru
dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.dhdurgee ought to be getting tired of karma fortunes by now.
 
Posts: 831
Karma: 2525050
Join Date: Jun 2010
Device: K3W, PW4
I am releasing a new version with pw3 support. I am updating first post with the new zip.

Dave
dhdurgee is online now   Reply With Quote
Reply

Tags
kt4, mp3, pw3, pw4, sox


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW [KUAL] Yet another clock extension MrTick Kindle Developer's Corner 3 10-21-2019 03:06 PM
xmahjongg for Kindle as Kual extension Hanspeter Kindle Developer's Corner 86 12-02-2016 07:06 PM
kual extension to open a book shoelesshunter Kindle Developer's Corner 14 08-16-2016 12:30 PM
is there any KUAL extension development guide? fangzi Kindle Developer's Corner 2 01-02-2014 10:11 AM


All times are GMT -4. The time now is 05:41 PM.


MobileRead.com is a privately owned, operated and funded community.