Giter Site home page Giter Site logo

Comments (17)

korbav avatar korbav commented on May 26, 2024

Hi, indeed, you should use fromElement instead, but that's not your only problem.
I just checked your code and it seems there are plenty of other issues.

  • First of all, your server does not serve the audio files with a CORS header, which will block the request from another domain, codepen.io is another domain.
  • Secondly, if my understanding of your UI is correct you don't need multiple canvas and you don't need multiple audio elements.
  • Also, you have a styling problem, easy to fix but which prevent you from clicking directly from the play button for the "body upbeat" for example

I created another codepen with some fixes. I didn't correct the style I mentioned above.
I replaced your file just by another audio coming from a server with CORS headers enabled.
I got rid of the useless canvas & audios elements.
I created a single one audio element, and one single canvas element that I put above the background image.
I also cleaned your code, I created a function so that you don't have to repeat yourself 100 times if you have 100 ambiance sounds.
You will see I commented the lines where the audio file & types are supposed to be loaded dynamically, because your server has no CORS, when you will enable CORS, you can uncomment and it will work.

You can find my fork here: https://codepen.io/bil59/pen/JjNNzao

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

from wave.js.

korbav avatar korbav commented on May 26, 2024

Thank you. This will ultimately be moved to the project hosting domain so that should fix the CORS issue. I wanted the fireworks to begin with turquoise but progress with the colors of the song title sub-text (teal, pink, purple) based on the song that is playing... I’ll check out my styling issue, I was wondering why I couldn’t click. Thank you for the link. I have forked it, and will work on it this evening. I do appreciate your help and look forward to showing you my final works. Toni From: korbav @.*** Sent: Saturday, July 17, 2021 8:14 PM To: foobar404/Wave.js Cc: Toni Shortsleeve; Author Subject: Re: [foobar404/Wave.js] Is there a playFile instead of playStream? (#34) Hi, indeed, you should use fromElement instead, but that's not your only problem. I just checked your code and it seems there are plenty of other issues. * First of all, your server does not serve the audio files with a CORS header, which will block the request from another domain, codepen.io is another domain. * Secondly, if my understanding of your UI is correct you don't need multiple canvas and you don't need multiple audio elements. * Also, you have a styling problem, easy to fix but which prevent you from clicking directly from the play button for the "body upbeat" for example I created another codepen with some fixes. I didn't correct the style I mentioned above. I replaced your file just by another audio coming from a server with CORS headers enabled. I got rid of the useless canvas & audios elements. I created a single one audio element, and one single canvas element that I put above the background image. I also cleaned your code, I created a function so that you don't have to repeat yourself 100 times if you have 100 ambiance sounds. You will see I commented the lines where the audio file & types are supposed to be loaded dynamically, because your server has no CORS, when you will enable CORS, you can uncomment and it will work. You can find my fork here: https://codepen.io/bil59/pen/JjNNzao — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#34 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMNNCNSST6T3Y7BKVUZ3WTTYJBHDANCNFSM5ARMAT2Q . https://github.com/notifications/beacon/AEMNNCJTYX2GNVSFXAERU4TTYJBHDA5CNFSM5ARMAT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSJBXNY.gif

My pleasure, I would be glad to see it :)

One really dumb question, but I can’t make it work: How do I get the fireworks below the player (lower right of column under the current image) and how do I place it in a straight line instead of a circle? Thank you. From: korbav @.*** Sent: Saturday, July 17, 2021 8:14 PM To: foobar404/Wave.js Cc: Toni Shortsleeve; Author Subject: Re: [foobar404/Wave.js] Is there a playFile instead of playStream? (#34) Hi, indeed, you should use fromElement instead, but that's not your only problem. I just checked your code and it seems there are plenty of other issues. * First of all, your server does not serve the audio files with a CORS header, which will block the request from another domain, codepen.io is another domain. * Secondly, if my understanding of your UI is correct you don't need multiple canvas and you don't need multiple audio elements. * Also, you have a styling problem, easy to fix but which prevent you from clicking directly from the play button for the "body upbeat" for example I created another codepen with some fixes. I didn't correct the style I mentioned above. I replaced your file just by another audio coming from a server with CORS headers enabled. I got rid of the useless canvas & audios elements. I created a single one audio element, and one single canvas element that I put above the background image. I also cleaned your code, I created a function so that you don't have to repeat yourself 100 times if you have 100 ambiance sounds. You will see I commented the lines where the audio file & types are supposed to be loaded dynamically, because your server has no CORS, when you will enable CORS, you can uncomment and it will work. You can find my fork here: https://codepen.io/bil59/pen/JjNNzao — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#34 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMNNCNSST6T3Y7BKVUZ3WTTYJBHDANCNFSM5ARMAT2Q . https://github.com/notifications/beacon/AEMNNCJTYX2GNVSFXAERU4TTYJBHDA5CNFSM5ARMAT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSJBXNY.gif

I created another fork with your requirements : https://codepen.io/bil59/pen/YzVQVwj

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

from wave.js.

korbav avatar korbav commented on May 26, 2024

How do I get the server to serve the audio files with a CORS header? I’m hosted on a secure site and thought that would fix the issue. From: korbav @.*** Sent: Saturday, July 17, 2021 8:14 PM To: foobar404/Wave.js Cc: Toni Shortsleeve; Author Subject: Re: [foobar404/Wave.js] Is there a playFile instead of playStream? (#34) Hi, indeed, you should use fromElement instead, but that's not your only problem. I just checked your code and it seems there are plenty of other issues. * First of all, your server does not serve the audio files with a CORS header, which will block the request from another domain, codepen.io is another domain. * Secondly, if my understanding of your UI is correct you don't need multiple canvas and you don't need multiple audio elements. * Also, you have a styling problem, easy to fix but which prevent you from clicking directly from the play button for the "body upbeat" for example I created another codepen with some fixes. I didn't correct the style I mentioned above. I replaced your file just by another audio coming from a server with CORS headers enabled. I got rid of the useless canvas & audios elements. I created a single one audio element, and one single canvas element that I put above the background image. I also cleaned your code, I created a function so that you don't have to repeat yourself 100 times if you have 100 ambiance sounds. You will see I commented the lines where the audio file & types are supposed to be loaded dynamically, because your server has no CORS, when you will enable CORS, you can uncomment and it will work. You can find my fork here: https://codepen.io/bil59/pen/JjNNzao — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#34 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMNNCNSST6T3Y7BKVUZ3WTTYJBHDANCNFSM5ARMAT2Q . https://github.com/notifications/beacon/AEMNNCJTYX2GNVSFXAERU4TTYJBHDA5CNFSM5ARMAT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSJBXNY.gif

Which provider is it?
Either you can activate the option somewhere in your account, or if you have a full access you can configure by yourself the server.
If not, you can create a .htaccess, and if it's disabled you can also create a PHP file to proxy your audio files.

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

from wave.js.

korbav avatar korbav commented on May 26, 2024

Hi, I was able to upload and avoid the CORS issue. Thank you for your help. The file is sitting here: https://www.kalukiskreations.com/projects/healing.html And the image and colors do change when it’s play icon is clicked. However, it will only play the original sound chosen. How do I get it to loop through the playlist when I want to go from one song to the other? Thank you, Toni From: korbav @.*** Sent: Monday, July 19, 2021 10:10 AM To: foobar404/Wave.js Cc: Toni Shortsleeve; Author Subject: Re: [foobar404/Wave.js] Is there a playFile instead of playStream? (#34) How do I get the server to serve the audio files with a CORS header? I’m hosted on a secure site and thought that would fix the issue. From: korbav @.*** Sent: Saturday, July 17, 2021 8:14 PM To: foobar404/Wave.js Cc: Toni Shortsleeve; Author Subject: Re: [foobar404/Wave.js] Is there a playFile instead of playStream? (#34 <#34> ) Hi, indeed, you should use fromElement instead, but that's not your only problem. I just checked your code and it seems there are plenty of other issues. * First of all, your server does not serve the audio files with a CORS header, which will block the request from another domain, codepen.io is another domain. * Secondly, if my understanding of your UI is correct you don't need multiple canvas and you don't need multiple audio elements. * Also, you have a styling problem, easy to fix but which prevent you from clicking directly from the play button for the "body upbeat" for example I created another codepen with some fixes. I didn't correct the style I mentioned above. I replaced your file just by another audio coming from a server with CORS headers enabled. I got rid of the useless canvas & audios elements. I created a single one audio element, and one single canvas element that I put above the background image. I also cleaned your code, I created a function so that you don't have to repeat yourself 100 times if you have 100 ambiance sounds. You will see I commented the lines where the audio file & types are supposed to be loaded dynamically, because your server has no CORS, when you will enable CORS, you can uncomment and it will work. You can find my fork here: https://codepen.io/bil59/pen/JjNNzao — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#34 (comment) <#34 (comment)> > , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMNNCNSST6T3Y7BKVUZ3WTTYJBHDANCNFSM5ARMAT2Q . https://github.com/notifications/beacon/AEMNNCJTYX2GNVSFXAERU4TTYJBHDA5CNFSM5ARMAT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSJBXNY.gif Which provider is it? Either you can activate the option somewhere in your account, or if you have a full access you can configure by yourself the server. If not, you can create a .htaccess, and if it's disabled you can also create a PHP file to proxy your audio files. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#34 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMNNCJD3QYPV45RJE4YLY3TYRL5XANCNFSM5ARMAT2Q . https://github.com/notifications/beacon/AEMNNCOX2PZLJGDA23GCX2LTYRL5XA5CNFSM5ARMAT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSOSMLQ.gif

You can take advantage of the onended method of the audio player, here you go : https://codepen.io/bil59/pen/ZEKXeNg

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

Thank you. That is helpful. And it does work once the song has ended.

But I cannot pause it while it is process, and choose another song to play instead. It will only play the original chosen song. Though the image does change.

Is this possible?

Otherwise I can only change songs by refreshing the entire page.

from wave.js.

korbav avatar korbav commented on May 26, 2024

Thank you. That is helpful. And it does work once the song has ended.

But I cannot pause it while it is process, and choose another song to play instead. It will only play the original chosen song. Though the image does change.

Is this possible?

Otherwise I can only change songs by refreshing the entire page.

I implemented the pause/resume/change track features in your code https://codepen.io/bil59/pen/ZEKXeNg

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

Hi,
Thank you.
The console log does show the first vs the current song.
But the sound is still of the first song ... This is what I hear on the codepen too.

from wave.js.

korbav avatar korbav commented on May 26, 2024

Hi,
Thank you.
The console log does show the first vs the current song.
But the sound is still of the first song ... This is what I hear on the codepen too.

Yes this is because the test server (with CORS enabled) only contains one single song, so you have the impression that it's not updated but it's actually updated, you can inspect the src attribute of the source element with your developer console to see it in action.

When you will replace the tracks with your real server ones you will hear the difference.

PS: I removed the console message you noticed
Last version updated at the same place: https://codepen.io/bil59/pen/ZEKXeNg

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

Hi,
The same thing happened on the live server.
I'm not sure what I've done wrong...
Here's the link:
https://www.kalukiskreations.com/projects/healing.html
You can see the console.log (thank you) shows the correct file name:
image

But the sound continues to only play the first song.

from wave.js.

korbav avatar korbav commented on May 26, 2024

Hi,
The same thing happened on the live server.
I'm not sure what I've done wrong...
Here's the link:
https://www.kalukiskreations.com/projects/healing.html
You can see the console.log (thank you) shows the correct file name:
image

But the sound continues to only play the first song.

You have forgotten to correct a previous type while editing your script :
player.innerhHTML = ''; should be player.innerHTML = '';

As you can see, it works well with different files https://codepen.io/bil59/pen/MWmOVjj

from wave.js.

KoniKodes avatar KoniKodes commented on May 26, 2024

Oh my, it's the little things. This is why we need documentation editors...

Thank you so much for catching that. Yes, it works great now.
Just in time for her birthday party today.

Please let me know how I can buy you a cup of coffee or a glass of wine. Paypal or other?

from wave.js.

korbav avatar korbav commented on May 26, 2024

Oh my, it's the little things. This is why we need documentation editors...

Thank you so much for catching that. Yes, it works great now.
Just in time for her birthday party today.

Please let me know how I can buy you a cup of coffee or a glass of wine. Paypal or other?

It's my pleasure, I'm glad it worked at time for the birdthday party it's pretty enough for me to make you happy, enjoy this unvaluable time :)

from wave.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.