Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post Posted: March 25th, 2017, 7:19 pm 
 

Joined: November 30th, 2016, 9:08 am
Posts: 5
How would you get this code running for sound outside of framework, i tried something and it kinda works but the sound is real bad quality, i think its because (I put play() in while ) it processes to slow but in framework its in wWinMain and i got real lost there... Pleas some help or advice some link or something on how i can make it sound smooth ... I'm trying to understand APIs better :). And Chill you helped me a lot in learning to program thank a lot I LOVE YOU´╗┐...


Top 
 Profile  
Reply with quote  
 Post Posted: March 26th, 2017, 7:40 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3470
Location: Japan
Need to see your full code before we can even begin to guide you bro.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: March 26th, 2017, 12:13 pm 
 

Joined: November 30th, 2016, 9:08 am
Posts: 5
Here it is bro :D
https://github.com/IvanBacic/SimpleAudioLoader


Top 
 Profile  
Reply with quote  
 Post Posted: March 26th, 2017, 1:42 pm 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3470
Location: Japan
Ah nice, repo. I will take a look at this in a bit bro. Might take me a day or two, but I will see what's going wrong and hopefully give you some pointers. If somebody else wants to jump in and give advice that's cool too.

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: March 26th, 2017, 2:09 pm 
 

Joined: November 30th, 2016, 9:08 am
Posts: 5
Thanks man, take your time, any tip helps :)


Top 
 Profile  
Reply with quote  
 Post Posted: March 26th, 2017, 7:18 pm 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2828
Location: Oklahoma, United States
Code:

int main()
{
   Sound TheEnd = Sound(L"C:\\Users\\Ivan\\Desktop\\programiranje\\SimpleAudioLoader\\TheEnd.mp3");

      while (true) {
         TheEnd.Play();
      }
   return 0;
}


I believe your original thought is correct, you are unconditionally playing this sound each loop iteration. You would want to check if the sound file is finished playing before playing it again. I don't think chili's version has a way to tell built in, but I'm sure you could figure out how to write a function that returns a bool if file is still playing or if it is done playing.

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: March 27th, 2017, 2:06 pm 
 

Joined: November 30th, 2016, 9:08 am
Posts: 5
OOOOOOOOoouuouou albinopapa thanks man for idea i figure it out. Now it plays smooth :) i'll uploud update version soon when i put sam options for play stop and that staff :) thanks.


Top 
 Profile  
Reply with quote  
 Post Posted: March 27th, 2017, 2:36 pm 
 

Joined: November 30th, 2016, 9:08 am
Posts: 5
hey :D . Is it possible to implement pause with this ??
i think i can make next or something like that but i cant find anything about pause in XAudio\XAudio2.h i think it uses stop and play form here .and maybe (I'am asking to much) to select time to start playing hehe :D. I'll try and let you know if i successfully find something.


Top 
 Profile  
Reply with quote  
 Post Posted: March 27th, 2017, 7:07 pm 
 

Joined: February 28th, 2013, 3:23 am
Posts: 2828
Location: Oklahoma, United States
Yeah, Pause is just stopping the audio and resuming from where the stream was stopped.

_________________
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com


Top 
 Profile  
Reply with quote  
 Post Posted: March 29th, 2017, 7:20 am 
User avatar

Joined: May 23rd, 2013, 3:52 pm
Posts: 1236
Location: USA
all you have to do is call Play, XAudio will continue from where it stopped :) (only extra has to be done for a full stop ;))

_________________
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
irc://irc.freenode.net/#pchili alt -- join up if ever want real-time help or to just chat :mrgreen: --


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 10 posts ] 

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron