after many Stackoverflow and youtube search, this video provided a simple solution. Thank you
@NiklasZiermann2 жыл бұрын
You're welcome. I'm glad I could help :)
@linak19097 ай бұрын
Thank you so much for this excellent tutorial🙏 straight to the point
@NiklasZiermann7 ай бұрын
You're welcome. I'm glad I could help :)
@brandonmchugh9821 Жыл бұрын
Amazing. This is exactly what I was looking for. THanks!!!!!
@NiklasZiermann Жыл бұрын
You're welcome :)
@reise254 Жыл бұрын
(edit, added howler) This worked thanks! But.. after a while I got a "distorted/corrupted" sound. Tried everything, the only fix that worked for me was using Howler library instead of the built in HTML audio player in the video. $ `npm i howler`
@NiklasZiermann Жыл бұрын
That's unfortunate. Sorry to hear that... But thank you for pointing out an alternative solution :)
@amanrubey9 ай бұрын
thanks!!!!! howler indeed worked, nothing else was working and I was exasperated and so depressed
@sebastianlozano77077 ай бұрын
straigth to the point! Thanks so much
@NiklasZiermann7 ай бұрын
You're welcome :)
@Diamondyy11 ай бұрын
Hey there! I'm running into a bit of a hiccup and I hope someone can lend a hand. I'm trying to build my React app, but I keep getting this error message: Module parse failed: Unexpected character '�' (1:5) It seems to be related to the sound file (I'm using the same WAV file). Any advice on how to resolve this? Thanks in advance! 👍
@NiklasZiermann11 ай бұрын
It's probably an issue with your bundler settings. Depending on what bundler you use you'll need to configure wav files as assets/resources. This way it will import just the path to the file instead of interpreting the file as javascript. How you do this depends on your bundler (vite, webpack, bun) but just googling ' import as static asset' should probably do the trick :)
@c_zeroyt2556 Жыл бұрын
Thank you , best one on youtube
@maxs_hidden2 ай бұрын
Good video. Thanks!
@harshitsuyal8285 Жыл бұрын
Thankyou so much brother it’s very helpfull
@NiklasZiermann Жыл бұрын
You're welcome :)
@web.mayk3l6 ай бұрын
Nice video
@NiklasZiermann6 ай бұрын
Thanks, I'm glad you liked it :)
@andrew526008 ай бұрын
Excellent video.
@NiklasZiermann8 ай бұрын
Thank you :)
@Tube-hn9rc9 ай бұрын
thank you sir that is really helpfull
@NiklasZiermann9 ай бұрын
You're welcome! I'm glad I could help :)
@akmalabid_fip5376 Жыл бұрын
thx so much, is there any way that the volume value can be controled with input range ?
@NiklasZiermann Жыл бұрын
Yes there is. You can controll the volume of your Audio object using the volume atrribute (0=no sound, 1=max volume). So just set the range of your input to be between 0 and 1 and use a useffect to change the volume attribute whenever the input's value changes.
@omgitskuei7 ай бұрын
Your solution doesnt work!!! NextJS crashes at Build stage, returning error: Module parse failed: unexpected character ' ' with MP3 files
@NiklasZiermann7 ай бұрын
Thats because you need to tell nextjs that it should handle mp3 files as resources / assets. Right now it treats your mp3 as a JS file. Once you've done that everything should work :)
@pixerize-me6 ай бұрын
One way to use audio in NextJS is to put your audio file in the public folder and then do, without import, just use audio = new Audio('/assets/sounds/incoming.wav');
@omgitskuei6 ай бұрын
This worked! Can't thank you enough,@@pixerize-me !
@giolosaberidze361310 ай бұрын
what if i want to play different sounds on different buttons, can u help?
@NiklasZiermann10 ай бұрын
Sure, you do the same thing as shown in the video and for every button you just use another Audio object with another source-file
@luv.matters9 ай бұрын
I'm just asking the same above lol
@luv.matters9 ай бұрын
@@NiklasZiermann rather than having multiple, would it make sense to use an object?
@NiklasZiermann9 ай бұрын
@@luv.matters Using only one audio object will most likely cause issues when multiple sounds play simultaniously. So I'd recommend using one object per sound effect. You can of course put all of these Audio objects into a data-structure, to make accessing them easier :)
@janoscodes Жыл бұрын
Thank you so much
@NiklasZiermann Жыл бұрын
You're welcome :)
@johnathanvalorant697 Жыл бұрын
nice m8
@boyywnkobe Жыл бұрын
how to stop ?
@NiklasZiermann Жыл бұрын
The Audio Object should have a .pause() method. Try using that :)
@turgunov28 Жыл бұрын
thanks man
@NiklasZiermann Жыл бұрын
You're welcome :)
@lucasmarques2871 Жыл бұрын
Straight to the point, thank you very much!
@NiklasZiermann Жыл бұрын
You're welcome :)
@haanghuy5 ай бұрын
Hello, can you make a video tutorial on playing audio using base64 string in react native
@uiltonKeyboard Жыл бұрын
Hey buddy, I'm using this already in my project. My question here is: I have some customers that is using the app on the mobile device, so when some new message comes, I dispatch a sound, but when the device is locked, the sound is not emitted. Do you know any workaround about this? Thanks in advance.
@NiklasZiermann Жыл бұрын
Unfortunately I dont think that there's a workaround for that specific issue. But you might be able to use the Notifications API as a solution :)
@payamrezaei-eg8dz5 ай бұрын
i have impelementing an book with audio sound for each paragraph that api gives me the audio files by each api call and i want make toggle button to play and pause and other buttons not work till get pause or ended
@NiklasZiermann5 ай бұрын
If you want every source to work independently, then you'll need one audio object per source
@luv.matters9 ай бұрын
Now how do you do it with multiple sounds like a drumkit?
@NiklasZiermann9 ай бұрын
Just create one Audio object for each sound and play them accordingly :)