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 04-30-2020, 12:54 PM   #91
trcm
Connoisseur
trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!
 
Posts: 96
Karma: 100000
Join Date: Dec 2018
Location: London
Device: Kobo Libra H2O
https://gist.github.com/tomtastic/f8...bc7788a3ddc3c4
trcm is offline   Reply With Quote
Old 04-30-2020, 01:07 PM   #92
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The "stop parsing whatever comes next as getopt flags" marker (--), while good practice (especially after a "read from stdin" one), is unneeded here, as there isn't anything passed after it.

What did fix it is running it directly, preventing the pipe from being quoted, which effectively broke the pipeline, since there was no longer a pipeline ^^.
NiLuJe is offline   Reply With Quote
Old 04-30-2020, 01:17 PM   #93
trcm
Connoisseur
trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!trcm rocks like Gibraltar!
 
Posts: 96
Karma: 100000
Join Date: Dec 2018
Location: London
Device: Kobo Libra H2O
Quote:
Originally Posted by NiLuJe View Post
What did fix it is running it directly, preventing the pipe from being quoted, which effectively broke the pipeline, since there was no longer a pipeline ^^.
He had tried to run it directly ...

Code:
echo "Try as per NiLuJe:"

echo ""

 /mnt/us/extensions/sox/sox $1 -t raw - | /usr/bin/gst-launch -v filesrc location=/dev/stdin ! $caps ! queue ! mixersink
and he got

Code:
(gst-launch-0.10:17914): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion `gst_uri_is_valid (uri)' failed
WARNING: erroneous pipeline: no element "audio"
trcm is offline   Reply With Quote
Old 04-30-2020, 02:02 PM   #94
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: 914
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
Thank you both for your assistance. Starting with your working script I made a few other minor tweaks and it appears to be working properly. I dropped the "-v" from gst-launch as I only wanted that to assist diagnosing where something failed and I added a trailing "&" to detach the pipeline and allow the script to exit. I also confirmed that I can use killall to stop it playing.

I am starting to work on a script to play an internet stream derived from this one. It requires use of curl to get a few seconds sample of the stream to derive the parameters for playback and the arguments to the script must identify the type of the stream as soxi won't guess it.

Dave
dhdurgee is offline   Reply With Quote
Old 04-30-2020, 03:49 PM   #95
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@trcm:

$caps was still a multi-word quoted mess in that example .

(i.e., it's unrelated to the sox getopt stop, which was the only point I was trying to make ).
NiLuJe is offline   Reply With Quote
Old 05-01-2020, 08:07 PM   #96
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: 914
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
I want to thank you both for your assistance with this project. I have reached the point where I have put together an initial KUAL menu, but I am having some issues with it that I don't understand. Perhaps you can assist me.

The menu is at present a top level menu and an internet radio sub-menu. The top level has an entry to play all music on the device, an entry to stop playback and an entry to the internet radio menu. These entries work, but the first two exit KUAL to the home directory for some reason. The internet radio sub-menu has some stations I play on occasion. These work and remain in the sub-menu in KUAL.

Obviously I would prefer the top level menu choices to remain there and not exit KUAL to the home directory. I would also like to have the internet sub-radio menu entries return to the top level menu after use, as you need to be there to stop playback.

Any suggestions appreciated. It would also be nice to know if this works on a USB audio Kindle.

Dave
Attached Files
File Type: zip sox.zip (2.18 MB, 313 views)
dhdurgee is offline   Reply With Quote
Old 05-01-2020, 08:28 PM   #97
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@dhdurgee: There's a typo in the toplevel exitmenu keys, you have an extra colon in there .
NiLuJe is offline   Reply With Quote
Old 05-01-2020, 10:19 PM   #98
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: 914
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by NiLuJe View Post
@dhdurgee: There's a typo in the toplevel exitmenu keys, you have an extra colon in there .
Opps! Thanks for the pointer.

If you have the time I would appreciate a look over the code to see if I have violated best practices in this environment.

One thing I would like to add at some point would be a menu entry to open a file selection dialog to allow the user to browse and select a file to play. I have no idea how to do so in this environment. Another possibility would be an input box to accept either a filename or a URL that could be copied from elsewhere, assuming there is a way to copy such for later pasting.


Dave
dhdurgee is offline   Reply With Quote
Old 05-02-2020, 01:02 PM   #99
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: 914
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
Is there an option in the KUAL menu to return from a sub-menu to the main menu after an option is selected? I would like to do so for the internet radio choices, as the stop playing media is in the top menu.

Dave
dhdurgee is offline   Reply With Quote
Old 05-02-2020, 01:49 PM   #100
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Quote:
Originally Posted by dhdurgee View Post
One thing I would like to add at some point would be a menu entry to open a file selection dialog to allow the user to browse and select a file to play. I have no idea how to do so in this environment. Another possibility would be an input box to accept either a filename or a URL that could be copied from elsewhere, assuming there is a way to copy such for later pasting.
Nope, it's a dumb menu, not an UI toolkit .

Quote:
Originally Posted by dhdurgee View Post
Is there an option in the KUAL menu to return from a sub-menu to the main menu after an option is selected?
That would be a no, too.
NiLuJe is offline   Reply With Quote
Old 05-02-2020, 02:48 PM   #101
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: 914
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by NiLuJe View Post
Nope, it's a dumb menu, not an UI toolkit .

That would be a no, too.
I guess it should be possible to do so with python, but I have never worked with that. How difficult would it be to create such a dialog and either call the shell script or do what it does as well? Any examples if this is a reasonable exercise for a novice in the language?


Oh well, guess I will add another "Stop playing media" to the sub-menu instead.

Thanks again for your assistance.

Do you think this is ready for a wider audience, or is there more I should do first?

Dave
dhdurgee is offline   Reply With Quote
Old 05-02-2020, 03:41 PM   #102
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Quote:
Originally Posted by dhdurgee View Post
I guess it should be possible to do so with python, but I have never worked with that.
Again, not without an UI toolkit.
NiLuJe is offline   Reply With Quote
Old 05-02-2020, 05:07 PM   #103
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: 914
Karma: 3000002
Join Date: Jun 2010
Device: K3W, PW4
Quote:
Originally Posted by NiLuJe View Post
Again, not without an UI toolkit.
Is there a UI toolkit available for this environment? What interfaces with it that is available here? Is it Java? Is there a tutorial on such things? Sounds a bit beyond my level, but who knows?

Dave
dhdurgee is offline   Reply With Quote
Old 05-02-2020, 05:14 PM   #104
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
KUAL was not really made to be extensible on the Java side, but, on FW 5.x (and only there), it technically has access to the standard Java UI kit, IIRC. You'd have to come up with the Java frontend *and* how to make that interact with the awk backend, though. That'd be extremely non-trivial.

The only somewhat usable toolkit available on stock devices is gtk2, c.f., kterm & co.

Otherwise, you can do it all by hand with a custom input loop and custom drawing primitives and FBInk ;D.

That still won't solve the lack of integration/interaction with KUAL, though.

TL;DR: No. The best you can do is building "dynamic" menus (c.f., the K5 Fonts hack and its font override extension).

Last edited by NiLuJe; 05-02-2020 at 05:17 PM.
NiLuJe is offline   Reply With Quote
Old 05-12-2020, 01:28 PM   #105
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,814
Karma: 103362673
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by dhdurgee View Post
I am uploading it here as github would not accept a zip file, strange omission there.
It's not an omission.

If you had uploaded the sox directory and all its contents, made a commit, and tagged that commit as something like v0.1 github would consider that commit a release. (github uses some heuristic to decide whether a tag name is a release.) Interested people can download any release as a zip or tar.gz at their choice without having to clone the repository.

If you make a change to playfile.sh in the git working tree on your computer and have tested it and are ready to release, it can be as simple as:
Code:
git commit -a
git tag v0.2
git push
git push --tags
(You might get prompted for username and password, depending on how your github account and local git are configured.)

Boom. You just made a new release and didn't have to zip anything up, clean up your working tree, only uploaded changes to a file, and didn't have to muck around in a web browser getting the file to the correct place.

And collaborators can do a git pull and only sox/playfile.sh and their repository clone change on their systems, and they can easily see what the changes were.

To reiterate, github automatically packages up up releases and releases are published by simply appropriately tagging a commit.
j.p.s is offline   Reply With Quote
Reply

Tags
audiobook, bluetooth, jailbreak, m4b, mp3


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with finding audiobook metadata on Amazon angelyne Calibre 6 10-21-2018 08:52 AM
Listen Audiobook Player question Hrafn Audiobook Hardware & Software 0 06-16-2018 02:36 AM
Listen Up - We've got a brand new audiobook forum Alexander Turcic Announcements 11 09-10-2014 06:18 PM
Amazon Ebooks and downloaded Audiobook ErikaGC Kindle Fire 1 06-10-2013 12:13 PM
Sony & Amazon, etc. - Why No Wifi or Bluetooth? poohbear_nc News 8 08-26-2009 04:29 PM


All times are GMT -4. The time now is 06:39 AM.


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