No sound
Author |
Message |
william 01

|
Posted: Thu Feb 24, 2011 3:30 pm Post subject: No sound |
|
|
What is it you are trying to achieve?
trying to get turing to play a mp3 when user enters H to go with my lights
What is the problem you are having?
not getting any audio, not muted, volumes up, right type of file, ... ect
Describe what you have tried to solve this problem
tried all formes of music code (Music.PlayFile, ... ect)
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
%William Frisk
var light : string
var x : array 1 .. 3 of int := init (200, 277, 355)
var y : array 1 .. 3 of int := init (190, 310, 190)
colorback (yellow)
cls
View.Set ("graphics")
Draw.FillPolygon (x, y, 3, brightcyan)
Draw.Polygon (x, y, 3, black)
Draw.FillBox (200, 190, 355, 60, brightblue)
Draw.Box (200, 190, 355, 60, black)
Draw.Box (215, 120, 250, 60, white)
Draw.Box (280, 140, 320, 175, white)
put "Which light would you like to turn on?"
locate (4, 14)
put "a. Geen light " ..
put "b. Yellow light " ..
put "c. Red light"
locate (5, 14)
put "d. Green and yellow light " ..
put "e. Green and red light"
locate (6, 14)
put "f. Yellow and red light " ..
put "g. all lights " ..
put "h. Surprise"
locate (24, 2)
loop
get light
if light = "a" then
parallelput (4)
Draw.FillOval (262, 90, 5, 5, green)
elsif light = "b" then
parallelput (2)
Draw.FillOval (232, 126, 5, 5, yellow)
elsif light = "c" then
parallelput (1)
Draw.FillOval (300, 183, 5, 5, brightred)
elsif light = "d" then
parallelput (6)
Draw.FillOval (262, 90, 5, 5, green)
raw.FillOval (232, 126, 5, 5, yellow)
elsif light = "e" then
parallelput (5)
Draw.FillOval (262, 90, 5, 5, green)
Draw.FillOval (300, 183, 5, 5, brightred)
elsif light = "f" then
parallelput (3)
Draw.FillOval (232, 126, 5, 5, yellow)
Draw.FillOval (300, 183, 5, 5, brightred)
elsif light = "g" then
parallelput (7)
Draw.FillOval (262, 90, 5, 5, green)
Draw.FillOval (232, 126, 5, 5, yellow)
Draw.FillOval (300, 183, 5, 5, brightred)
elsif light = "h" then
else
parallelput (0)
end if
end loop
|
Please specify what version of Turing you are using
Dont remember (4.1.5 i think) |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Insectoid

|
Posted: Thu Feb 24, 2011 3:41 pm Post subject: RE:No sound |
|
|
I don't see any sound commands in that code.
Unless you're doing it wrong, Turing probably isn't loading your sounds. Have you got the filepaths correct? |
|
|
|
|
 |
william 01

|
Posted: Thu Feb 24, 2011 3:49 pm Post subject: Re: No sound |
|
|
I have been using the file name methods, I don't know how to do the file paths.
the sound code is not there because i removed it because it was not working. If that hinders your help I'm sorry.  |
|
|
|
|
 |
Tony

|
Posted: Thu Feb 24, 2011 4:23 pm Post subject: RE:No sound |
|
|
you should show how you've tried to use it, in case there's something that might be obvious from looking at the full code. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
william 01

|
Posted: Thu Feb 24, 2011 7:16 pm Post subject: Re: No sound |
|
|
Turing: |
elsif light = "g" then
parallelput (7)
Draw.FillOval (262, 90, 5, 5, green)
Draw.FillOval (232, 126, 5, 5, yellow)
Draw.FillOval (300, 183, 5, 5, brightred)
elsif light = "h" then
Music.PlayFile ("rockthatbody.mp3")
else
parallelput (0)
end if
end loop
|
this is how I tried to do it. |
|
|
|
|
 |
Insectoid

|
Posted: Thu Feb 24, 2011 8:11 pm Post subject: RE:No sound |
|
|
Is 'rockthatbody.mp3 in the same folder as your source code? |
|
|
|
|
 |
william 01

|
Posted: Fri Feb 25, 2011 1:19 pm Post subject: Re: No sound |
|
|
yes it is. it woks now turns out there was a giant pause at the beginning of the sound file thank you for the help.  |
|
|
|
|
 |
|
|