[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lojban-beginners] Re: Now what?



On Apr 17, 2007, at 10:41 PM, Jon Top Hat Jones wrote:
I have both python and pygame installed already- I checked that before I downloaded the program. The program seems to run, but I can only get one of the 'levels' to load, and it searches for *.wav files when I press 'hear', but I downloaded the *.ogg ones.

Also, "Lojban Pronunciation.txt" (level 0) causes fatal error.

Here's the output of a sample run, first running level 0 (pronunciation), then level 1:
[ li'o sai ]


I don't have much idea what the output means, but I know that pygame is expecting the wav files.

If you find the line that plays the sounds (should be 260 or so) and change .wav to .ogg it should work. Assuming that the command to open the file also works.

Here's what my copy looks like around that part:

from line 114
        elif el[1]=="`": # In this case, we have the Lojban sentence
counter=string.join(el.split("`")[1].split ("\x00"),"").strip() # Voodoo for extracting Wav file number from unicode string
            toplay = datadir+os.sep+counter+".wav" # Wav file name
            ##toplay = datadir+os.sep+counter+".ogg" # Ogg file name

from line 231
                    break
                elif choice == "":
#os.system("realplay "+el[2][0]+" &") # Play the wav os.system("open "+el[2][0]+" && osascript -e 'tell application \"Terminal\" to activate'") # Play the wav
        else:
            #os.system("realplay "+el[2][0]+" &") # Play the wav
            #os.system("open "+el[2][0]+" &") # Play the wav
os.system("open "+el[2][0]+" && osascript -e 'tell application \"Terminal\" to activate'") # Play the wav
            time.sleep(el[2][1])

This part from line 231 is where the Mac-specific changes are -- the {open} command and the {osascript} stuff. You won't need that. Since you're getting errors from mPlayer, I'd guess that realplay does work/ exist on your machine.

Try the first one first -- if you have everything you need it should work if you give it the right extensions for the sound files (.ogg). But if you don't have realplay then you'll have to do some tweaking to the second part.

On a sidenote, you might give pygame03 a try, if you're not already using it. Actually, if you are using it, that might explain why you were getting errors from mplayer earlier. It's got a better interface and generally works better. Except on my system, where I can't get mplayer to play the wav files because it goes looking for an mp3 codec :)

mu'o mi'e .aleks.