|
#1
|
||||
|
||||
|
WaveCrave is a library developers can take and integrate into there apps and will be able to play a full length song while only taking up little ram.
in version 2.0 there are 2 examples included proving that you can play a full length song while doing something else. any comments, feedback, or concerns feel free to post. (if anyone can find the right settings to use in the convert that would be a big help) download: download the code in attachment below and download the songs from the following link and put the songs in WaveCrave\songs\ Songs NOTE: this app will not run properly in the adk because it uses wav.time() NOTE:The guitar game shows what this app will run like when the the parts are all differnt lenghts while the mario shows what will happen when the song parts are all the same lenght Last edited by jbob182; 09-16-2012 at 07:04 PM. |
|
|
|||
|
|
|
#2
|
||||
|
||||
|
I thought wave.time was only used to get the playing time (in milliseconds) of a loaded wave file.
I copyd this out of an app that was posted when this forum had just started It might help to explain what it does..Code:
sound1 = wav.load("mus1.wav");
Play_length = wav.time(sound1);
text.draw(10,10,"Play length sec. = "..Play_length/1000)
|
|
#3
|
||||
|
||||
|
it is used to get the lenght of the song. which is exactly what i want. the thing about the player is it's max it 10mb of ram and the way i do it it never exedds more that 7mb or so and you can adjust it to take up as much or as little as you want all you need to do is repeat a function a couple of more times
i am trying to make this as easy as possible for people to use. right now i am working on a timing mechanism. i have tried using framerate for a clock and am still working with that idea. note that since i can never exceed 10mb unless we can get an addon like there is for ds homebrew so we can use resources that never pile up on the ram the songplay will have some really short pauses here and there but it isnt that bad i wont be able to work on it for a few days though. |
|
#4
|
||||
|
||||
|
Quote:
[Thread split into its own]
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#5
|
||||
|
||||
|
Quote:
I don't get the problem with the clock, does it have to be 30 fps? If you really want seconds you can use os.time(), it returns seconds passed from 1970 or something, both on player and simulator. I guess you're using "play" for something else in the code as well. |
|
#6
|
||||
|
||||
|
Quote:
Quote:
Quote:
|
|
#7
|
||||
|
||||
|
Quote:
I notice there is a space between "song2:" and "play", that would explain the error? |
|
#8
|
||||
|
||||
|
no i had to use a space while typing this because otherwise it would say
![]() ---------------------------------------------------------------------------- i have fixed the bug and the program works now i just have to experiment with wav.time() Last edited by jbob182; 08-05-2010 at 09:49 PM. |
|
#9
|
||||
|
||||
|
Quote:
Code:
[ CODE][ /code]
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#10
|
||||
|
||||
|
ah thanks for the info and good new i have got wav.time to give me the lenght of the song in seconds and also os.clock to give me time in seconds all the parts are finished now
![]() there is only 1 bug left that is i cant get the audio to play at all on the player. I am completly baffled i have even hooked up my code to Taphero but still cant get it too work right |
|
#11
|
||||
|
||||
|
Quote:
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#12
|
||||
|
||||
|
i have thought of that so i just did a plain song
lay() right away no ifs and it worked fine right now i am resolving a problem where my app stuters but luckily my version with taphero still works
|
|
#13
|
||||
|
||||
|
Sounds good. This might be revolutionary for how we handle sounds. Will it be able to handle to abort in the middle of a song, play another sound, and continue where it left off? Think that'd be possible to achieve with your code? Because I'm kind of in search for such a code, since we can't run multiple threads in our apps.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#14
|
||||
|
||||
|
i think it is about time i explain what is really going on in my code. instead of a whole song I cut it into pieces in this case i use This Week I'v Been Mostly Playing Guitar by
Tommi Inkila which is a free song ![]() Then i set how many sections. Then it plays the first section, closes a dummy file i included that takes up like no space then it gets the lenght of the part afterwards it checks too see if my clock time matches with the part lenght if so then it loads a new part, plays it and closes the previous. restarts the clock and repeats the checking all the user has to do it chop a song in my case i do sections of 29 seconds then 14 then 29 ect which will only bring the ram up to about 7.2mb also they have to add the locations of the file and specify how many parts the only fallback is when it transits between parts there is a very short pause. It isnt that bad especially since this is the best we can do so far as for your question i believe it is possible this is how it could be done 1. start playing song 2. complete a few parts 3. when you stop the part in saves the current lenght and how long it has been playing 4. play a diffenrt song 5. resume by loading the part#, length of part, and play time, and the song ie: song = "TWIBMPG" part = 3 length = 29 songruntime = 20 i would need a function that could play a song from any time of it Last edited by jbob182; 08-05-2010 at 06:40 PM. |
|
#15
|
||||
|
||||
|
or you could just resume from a part it might set you back like 10 seconds but unless i have a function which i can play from anytime within the song it is all i can do
the function would look like wav.play(time); where time is what time in the song it starts |
|
#16
|
||||
|
||||
|
I see. Well, it should be good enough for what I want to do. Problem is only if I can implement it with everything else that needs to go on in the background. The only thing that is a shame is that you have to manually chop the file. Sure it's no problem really, but it's time consuming and may affect accuracy.
And wouldn't stuttering be solved simply by having two pre-loaded file sections? You might have to cut down on the time for them but if it removes the stuttering it won't matter.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#17
|
||||
|
||||
|
no that wasn't the problem i checked to make sure of that.
what was going on is i put in a wav.time() and as you know the adk returns 0 so it thought each part was 0 seconds long ![]() as for chopping the files up i wanted to make an exe but i don't know C or C++ or C# i only know some basic and java along with lua i might be able to create an code that virtualedub can read ie. reverse an avi file with a line or 3 of code. i will check on that part along with any other options. one other problem is that since i managed to get everything to give me time in seconds (ill explain how) which was VERY useful it had one downside : when a song is 29.855 seconds long it returns the length as 29 so a little bit of it gets chopped off what might work is i simply say +1 to the lenght value the one last thing i have to fix is the audio still wont play on the player. I have an adk and an xfi version so the adk can run fine but the xf version doesnt what i have done to test the bug to make sure it wasnt my audio files is a straight up Code:
TWIBMPG part 1:play() i might relese an beta version soon if i cant solve this bug or ask one member to look at it ---------------------------------------------------------------------------------------------------------------------- as for how i managed to get os.clock and wav.time to give me the time in seconds this is how Code:
songlength = wav.time(TWIGMPG part 1) songlength2 = songlength*2 length = os.difftime(songlength, songlength2) and there you go you have the time in seconds apparently os.difftime returns the value in seconds so it is differnt then just using the minus sign as for the clock just do the some thing |
|
#18
|
||||
|
||||
|
oh and as for the implanting i made very easy to intergrate i tell the person what goes where
as for doing stuff in the backround that was my first bug because i needed it in a while loop ![]() but got it out of the while loop an had to rethink most of the code then it didnt work so i simplified the entire code immensely and ]then all the parts were alot easier to programm i can intergrate it into anyone's code without a problem this is all I have to do note this is coming straight out of my code's comments Code:
-- include this line in you main code: dofile("songs/song.lua");
--[[ you need this to be where you want to start playing a song:
playing = true
part = 1
song = "enter song name here"
fullsong()
]]
--[[ this needs to be in the while loop of your code:
while true do
songcompare()
time1 = os.clock()
end
]]
|
|
#19
|
||||
|
||||
|
Sounds like some nice work man
Can't wait to see the whole code.Quote:
)Specifying the amount of parts used however, can be avoided when you let the code just keep loading parts until there is a load error, like this: Code:
part={}
x=0
parts=0
repeat
parts=parts+1
x=x+1
part[x]=wav.load("part" .. x .. ".wav")
until part[x]==nil
parts=parts-1
Maybe you can even use the leftovers to keep the part playing until it's really ended; Code:
songlength = wav.time(part.wav) -- in milliseconds leftover = (songlength/1000) - math.floor(songlength/1000) --gives milliseconds after rounded seconds songlength = math.floor(songlength/1000) --convert to seconds |
|
#20
|
||||
|
||||
|
ya i cant help either for the exe i might be able to create code in virtual dub to do it for you but that is the best i can do for now
as for the code about the loading to tell the truth i know very little about tables exept for animations and very basic stuff i wanted to just have the user specify the location but i needed a table to do so i will try and put that code into mine i might need some expalining first ok first line you create any emtey table called parts correct seconds line and trhird line you declare variables then you have the code repeats untill there is no more parts next you have it keep on adding how many parts then you keep on adding the tables section up by one each time along with the name of the part then you load a part by ..... this is where i loose you it seams the x is the part name ie. part 1 where 1 is x then part 2 is this what is going on? as for the leftover idea i will try that BUT first i need to resolve the last bug which i am stumped if any1 would like like to take a look and try and fix it then just pm me with your email when you pm an email you must use (at) and i think also (dot) 1. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 07:53 PM.











It might help to explain what it does..


Linear Mode
