Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----THIS IS THE TRACK CLASS I CALL INSIDE THE MAIN FILE------
- Track = {}
- function Track:new()
- Track.instanceTable = {}
- Track.activeTrack = {}
- Track.instanceTable = {
- [1] = {
- trackSnd = audio.loadStream( "Sound/Tracks/01.mp3", { volume=100} ),
- trackName = "track_01.mp3",
- trackStart = { [1] = {5000, 3000},
- [2] = {15000, 3000},
- },
- },
- }
- function Track:play( track, part )
- local chan = audio.findFreeChannel()
- local snd = Track.instanceTable[track].trackSnd, {channel = chan}
- local begin = Track.instanceTable[track].trackStart[part][1]
- local stop = Track.instanceTable[track].trackStart[part][2]
- print(begin, stop)
- local seek = audio.seek(begin, snd)
- audio.play(snd)
- audio.stopWithDelay(stop, chan)
- end
- end
- return Track
Advertisement
Add Comment
Please, Sign In to add comment