If I use length() on a /sound datum, will I get the length of the song?
Let's say I want to be able to play a song, and want all of the online players to hear the song at the EXACT position it's on.
For instance, let's say I have background music. Player A would hear it when he logs in. Then, Player B logs in. Player B hears it as well, but from the beginning. What I want it to do, is create a global /sound datum. Whenever someone logs in, they'll hear the background song exactly as others hear it.
And what does "streaming" do? Does it provide you with this feature? And if so, how would I use it properly?
ID:134657
![]() Feb 4 2006, 12:20 am
|
|
Artemio wrote:
length() would return the file's number of bytes, I believe. How will the channel help me? I want to be able to determine for how long a song has been playing, determine how much time the song consists of, and to be able to set the time of a song so it'll play on another time. Example: var/songa In this case, "songa" would be played to the world. If it's length is above a minute, at the end of the song, it will play from the first minute on. If stopped, it won't alert or replay. |
"Whenever someone logs in, they'll hear the background song exactly as others hear it."
Could play the channel to the target when they log in. |
Artemio wrote:
"Whenever someone logs in, they'll hear the background song exactly as others hear it." <insert confusedness here> Explain, please. |
mob That SHOULD play the song on channel 1 to the player from the song's current position. |
Qwerty2029 wrote:
If I use length() on a /sound datum, will I get the length of the song? Of course not. The length() proc is designed for only text, files, and lists. Lummox JR |
Nadrew wrote:
> mob That SHOULD play the song on channel 1 to the player from the song's current position. Actually since you didn't specify a file, that'll stop whatever sound is playing on channel 1. Lummox JR |
Oh, my bad -- I was thinking of another method but I forgot what =D. You can set a global variable to match the sound datum used for playing the song and output that variable to people logging in.
var That should work. |
Qwerty2029 wrote:
If I use length() on a /sound datum, will I get the length of the song? That's not posible with the current state of the sound datum. you can't even be certain when Player A and Player B will finish hearing the song if you send the song to them at the same time, because download time and CPU load could slow it down differently for each player. You can use the wait var for /sound on a specific channel to set up a playlist on a that channel that plays one after another, but that's the best you can hope for at the moment. And what does "streaming" do? Does it provide you with this feature? And if so, how would I use it properly? Streaming causes Dream Seeker to read the sound from disk instead of loading the entire thing into memory. Streaming frees up a lot of RAM, but you can't play that sound multiple times at once nor can you reverse playback. Streaming is ideal for background music, but ill suited for things like battle noises and interface beeps. Whether it's created as streaming or not, the sound must be downloaded by the client before it can be played. it is not streamed over the internet. |
Channel might help you: src<<sound(channel=1)