Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
moving from tkinter to wxpython
#81
Thanks. Cloned and ran KJ_BibleApp.py.
Am I missng something? Is it supposed to say the Names of the books anf chapters at the mouse hovers over them yet? Is it because of differences between WIndows and Linux?
I did
python3.6 RunMeOnce.py
python3.6 KJ_BibleApp.py
Which produced no sound so I tried
python3.6 ScrapeAudio.py
python3.6 UpdateBibleIndexAudioLinks.py
and then ran
python3.6 KJ_BibleApp.py
But still no sound.
Reply
#82
There is no sound, I fixed another problem that I had encountered, and also had to
work on another project for a few days.

The sound files are there, but not hooked in yet. I thought that the text should also
be shown at the same time since it's all there.

Almost all of this time (from the start) has been taken up on creating the dictionary that's loaded in
with this code:
        with self.bpath.IndexedBible.open() as f:
            self.bible = json.load(f)
at the beginning of the KJ_BibleApp.py program, and stored in the file: data/json/IndexedBible.json
Reply
#83
I'm looking for a better way to play audio, but for now will proceed with pygame.mixer.
I have a post which may bring some alternatives.
here's the simple test:
import BiblePaths
from pygame import mixer
import json
import os


class PlayAudio:
    def __init__(self):
        self.bpath = BiblePaths.BiblePaths()

        with self.bpath.IndexedBible.open() as f:
            self.bible = json.load(f)

    def play_chapter(self, volume, book, chapter):
        mp3loc = self.bible[volume][book][chapter]['mp3path']
        # found a bug, this is a hack until I fix the create program
        mp3loc[1] = str(mp3loc[1]).replace(' ', '_')
        mp3path = self.bpath.KingJamesAudiopath / mp3loc[0] / mp3loc[1]
        newpath = (mp3path.resolve()).as_posix()

        mixer.init()
        mixer.music.load(newpath)
        results = mixer.music.play()
        print('Press enter to quit')
        input()

def testit():
    pa = PlayAudio()
    pa.play_chapter('Old Testament', 'Jeremiah', '45')


if __name__ == '__main__':
    testit()
Reply
#84
At this point, I am done for now.

Code is working to the extent that you can play the audio for any book, any chapter using the GUI
The repository has been reverted back to Barrowman and several programs have been changed.
(So, regretfully needs to be cloned once more)

Known issues:
  • There is a bug associated with linking mp3 file names (somewhere in UpdateBibleIndexAudioLinks)
  • There is a hack in two programs to accommodate the bug PlayAudio and KJ_BibleApp
  • No scroll bats on Notebook pages, causing issue with Pslams (150 chapters) need to replace all notebook page panels with scrolledpanels.
To be done:
  • Add scrollbars to notebook pages
  • change License copyright owner to you (except for several modules that I copied from my other projects) PM me about this.
  • Add a page for viewing text along with audio (text is already there, just needs to be displayed)
  • Add speech recognition for navigation to make this really usable by the blind.
  • If you plan to make a commercial product, permissions are needed by text audio suppliers (again PM me)
Reply
#85
waiting for response
Reply
#86
Hi, sorry I didn't get back sooner. my wife has been very ill but improving now. I cloned the new stuff ran RunMeOnce and the KJ_BibleApp.py.
Can move from one book to another with tabs but not with the buttons on any page. No sound whatsever so no way my friend can even know the program is running unfortunately.
Reply
#87
which repository did you use? If you try the PlayAudio.py does it work?
And finally, check to see if OnClick (KJ_BibleApp.py) looks like:
    def OnClick(self, event):
        TargetId, pageidx, volume, book, chapter, page = event.GetEventObject().name
        if chapter is not None:
            mp3path = self.get_mp3_filepath(volume, book, str(chapter))
            mixer.init()
            mixer.music.load(mp3path)
            mixer.music.play()
        elif TargetId is not None:
            self.nb.SetSelection(TargetId)
I have to make a quick trip to wally mart to pick up a few things.
I'll take a look when I get back. Hope to see a reply to this by then.

Also, I sent you a Private Message, please respond to that.

Thanks.
Reply
#88
Yes, I tried the PlayAudio.py it gave no errors but also n sound.

I used the Barrowman repository. I have just repeated the cloning and all the rest. The tabs work to change to different books. From each page within a particular book only the Index button works.
The OnClick function is as you have asked.
There is still no sound whatsoever.
There are no errors reported as it runs. My old code does produce sound.
Reply
#89
See the PM.
The package is dependent on relative file structure.
If you change it, you will have to change the top part of BiblePaths.py (the paths area)
That should be all that's required, once this has been properly done, everything, even the
RunMeOnce.py module should work without a hitch.

You are getting no audio because the code doesn't know where to find the files. After you make above changes,
everything will work.
Reply
#90
We need to bring the discussion back on the forum. Others may be having problems as well.
It's now 6:06 AM here, I'm too tired to continue until I get some sleep.
Check that all dependencies (README.md) are installed.
The test I ran worked without a hitch for me.
Please show any errors you are encountering.

I'll be back for a short while in about three hours, then again at six.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020