Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sample volume of audio file every second?  (Read 4067 times)

0 Members and 1 Guest are viewing this topic.

oOhttpOo

  • Newbie
  • *
  • Posts: 40
    • View Profile
Sample volume of audio file every second?
« on: April 27, 2015, 04:46:27 pm »
I'm not expecting you to write a load of code for me (unless its very simple), but can anyone advise on if it is possible to sample the amplitutude/volume of the .wav/.ogg file every 1 second or less with the sfml audio? What function would allow me to do this? And please could you explain how it would work briefly if there is a function for it? Thanks  ;)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Sample volume of audio file every second?
« Reply #1 on: April 27, 2015, 05:17:41 pm »
Look at the audio tutorials and documentation. Everything that is possible is explained there.

Programming is about solving problems. If you have to rely on others to solve any problem for you, you'll have a really hard time.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

oOhttpOo

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: AW: Sample volume of audio file every second?
« Reply #2 on: April 27, 2015, 05:27:55 pm »
Look at the audio tutorials and documentation. Everything that is possible is explained there.

Programming is about solving problems. If you have to rely on others to solve any problem for you, you'll have a really hard time.

Righto. Is it possible to do this with the getSound function? I mean like once every 100 milliseconds or something

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Sample volume of audio file every second?
« Reply #3 on: April 27, 2015, 07:37:50 pm »
There is no getSound() function.

Documentation exists for a reason...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

oOhttpOo

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Sample volume of audio file every second?
« Reply #4 on: April 27, 2015, 11:03:47 pm »
The class or whatever it is. Some people are just so satirical with their posts they might of just not bothered to respond instead of actually trying to help. I'm not wasting anymore time going on this stupid forum, bye

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Sample volume of audio file every second?
« Reply #5 on: April 27, 2015, 11:48:52 pm »
If you are looking for help, the very least we can expect from you is that you express yourself clearly and show at least a bit of self-initiative. Apparently you don't even bother investing 2 minutes looking up the "class or whatever it is" in the documentation. Instead, you prefer letting us figure out what you could have meant, hoping that we solve your problem in the meantime. ::)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Sample volume of audio file every second?
« Reply #6 on: April 28, 2015, 02:19:44 am »
You may also want to consider what you mean by "volume". Do you mean the current position of the wave (sample value) or the perceived loudness (the overall volume of the sound) at that position?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*