Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Python

Python Discussion forum for Python, a high-level language with simple syntax, but yet powerful.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-2007, 08:09 PM
mevets's Avatar   
mevets mevets is offline
Newbie
 
Join Date: Nov 2006
Posts: 11
Rep Power: 0
mevets is on a distinguished road
Default Playing sound

[SOLVED] - I am making an alarm clock in python. This requires me to play a sound file just once. What is the easiest method to play a wav or ogg? I looked into the solutions and I saw people recommend pyMedia and ossaudiodev. Is pyGame a good idea?

Also, how would I even start to import something like pyGame? I know to add import pygame, but I do not know where I should put all the pygame code.
__________________
Steve M.

Last edited by mevets; 10-09-2007 at 09:21 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-05-2007, 12:07 AM
v0id's Avatar   
v0id v0id is offline
<img src="http://forum.codecall.net/images/userbar/supermod.png" alt="Super Moderator">
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,468
Last Blog:
CherryPy(thon)
Rep Power: 27
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

Which platform are you using?
I only know one way, if you are going to use the standard libraries, but it's only compatible with Windows.
Code:
import winsound
winsound.PlaySound("sound.wav", winsound.SND_FILENAME)
So if you're aiming for making your script cross-platform, or if you're on another platform, you probably need to use some third-party library, but I can't say which one is good for your purpose.

It's pretty easy to install new libraries. In your Python-directory, you've a file called "Lib," you just need to place the files in there. The library will probably have a README og INSTALL file, which would help you, if it need configuration, or something else first.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-05-2007, 09:33 AM
mevets's Avatar   
mevets mevets is offline
Newbie
 
Join Date: Nov 2006
Posts: 11
Rep Power: 0
mevets is on a distinguished road
Default

I am using linux. Someone said pyGame would be easiest. Does anyone know where pythons lib folder is located under linux? I saw /var/lib/python2.5. Is that it?
__________________
Steve M.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-09-2007, 09:20 PM
mevets's Avatar   
mevets mevets is offline
Newbie
 
Join Date: Nov 2006
Posts: 11
Rep Power: 0
mevets is on a distinguished road
Default

import pygame works but I had to first
Code:
sudo apt-get install python-pygame
__________________
Steve M.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer Sound Chan C# Programming 3 06-30-2007 12:36 PM
Getting sound volume values for different chanels. vanarebane C# Programming 2 03-11-2007 03:04 PM
Sounds and Sound Loop Resources TVDinner Website Design 0 03-10-2007 08:20 AM
Are you playing very often xtraze Video Game Talk 10 02-25-2007 01:50 PM
Using Timer to repeat a sound Question skilletsteve Visual Basic Programming 1 08-30-2006 12:59 PM


All times are GMT -5. The time now is 06:11 PM.

Contest Stats

Xav ........ 162.68
neerlin ........ 100
satrian ........ 100
delia ........ 100
chili5 ........ 70.08
morefood2001 ........ 42.41
MeTh0Dz|Reb0rn ........ 28.44
RyanTuosto ........ 20
gamiR ........ 19.64
John ........ 14.46

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads