![]() ![]() ![]() yourSound = playwave("goodvibes.wav") #starts sound, returns a reference to it Playwave, stopwave, getIsPlaying, loopwave, stoploop, and getIsLoopPlaying. The module essentially contains 6 functions: (or from preferredwaveplayer import * if you are opting for the faster waveplayer.) To use the module simply add: from oswaveplayer import * This is a much faster wave player than the oswaveplayer in Windows.) -Windows10 uses the Media.Soundplayer module built into Windows 10 -Linux uses ALSA which is part of the Linux kernel since version 2.6 and later -MacOS uses the afplay module which is present OS X 10.5 and later` Then all the same functions will be available below. Pip install preferredwaveplayer then the import statement from preferredwaveplayer import *. This can be installed by using the commmand: If you have time senstive sounds as in a fast-paced video game, for example, I would strongly recommend using the "preferredwaveplayer" module. (This module uses a simple process, and is expected to be dependable, but can be very slow in Windows. The player can issue commands to stop the subprocesses to stop playing the sounds. It simply issues subprocess calls to the operating system to play the sound, and as long as the operating system has not been significantly altered (you have not removed the operating system's wave playing applications) it should work. I wanted to write the simplest cross-platform wave player, that can do the basics and would not have any sort of dependencies. This is a simple wave player that uses the command line to issue instructions to the OS to play. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |