WordPress.org

Forums

Controlling music volume (12 posts)

  1. dennishall
    Member
    Posted 2 years ago #

    Hi:

    I'm loading mp3 files via a URL to the music file uploaded into WordPress.

    I cannot use a plugin for this because I am doing this inside an imap.

    The files load and play correctly, however, I am looking for a method of pre-setting the volume by adding a parameter in the URL.

    An example:
    What I have: href="http://mysite.com/wp-content/uploads/music/myfile.mp3"
    What I want: href="http://mysite.com/wp-content/uploads/music/myfile.mp3 volume="0.4""

    Does anyone know what HTTP parameter exists to pre-set mp3 audio volume?

    If yes, can you provide me an example?

    Best Regards,
    Dennis Hall

  2. phillbooth
    Member
    Posted 2 years ago #

    there are several ways you can do this
    make part of the file name the volume level and then use php

    <?php
    $mymp3 = http://mysite.com/wp-content/uploads/music/myfileVOL4VOL.mp3;
    
    $pieces = explode("VOL", $mymp3);
    
    echo $pieces[1]; //returns 4
    
    $myvolume=$pieces[1] / 100;
    ?>

    or put the value into WP Custom Field

    or use jquery to update HTML

  3. phillbooth
    Member
    Posted 2 years ago #

  4. dennishall
    Member
    Posted 2 years ago #

    Hi phillbooth:

    Thanks for getting back.

    I have built a music site for a volunteer band and have a number of audio files being presented in a hidden iframe. Unfortunately, I cannot use a plugin because all the plugins I've tried are playing automatically (due to the iframe).

    I have an introduction audio playing on entry, then an imap for users to play the other audio.
    Here is the site: http://wp.hudsonbigswingband.ca
    What I need to do is adjust the audio using only a http request, however, I could encapsulate the requests in php, so your initial idea is not dead.

    Let me know if you have other ideas that would work in a request string.

    Thanks for this help,
    Dennis Hall

  5. esmi
    Forum Moderator
    Posted 2 years ago #

    I have an introduction audio playing on entry,

    Please, please, do not do this! Playing any audio on site entry causes major problems for many users - not least of whom are those using screen reading software. And as web accessibility for disabled people may be mandated by law in your country, this could put your site on the wrong side of the law.

  6. dennishall
    Member
    Posted 2 years ago #

    Hi esmi:

    Actually, I'm a courseware developer and know all about 508 compliance (which is not an issue in Canada).

    Even so, I have the audio loading in an iframe, this means that a screen reader such as JAWS can still work without interruption in the WordPress site.

    Glad to know others are focused on 508 compliance.

    Best Regards,
    Dennis Hall

  7. dennishall
    Member
    Posted 2 years ago #

    Hi All:

    I seems the audio volume is no longer an issue only a curiosity on my part.

    The 89 year old site administrator (not a joke) has informed me that he had already reduced the volume in his latest mp3 published files.

    Thank you all for your help and concerns anyhow. You had great ideas.

    I will now be migrating the site to it's live location at http://www.hudsonbigswingband.ca in effect replacing the current Flash site I had made years past.

    Best Regards,
    Dennis Hall

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    Even so, I have the audio loading in an iframe, this means that a screen reader such as JAWS can still work without interruption in the WordPress site.

    Can you elaborate on that?

  9. dennishall
    Member
    Posted 2 years ago #

    Hi esmi:

    To elaborate:

    JAWS is a U.S. Government authorized screen reading program.

    An iframe is a "hole" in your webpage that allows you to display / manipulate another webpage or another URL, however, this page or URL is not part of your webpage, therefore screen readers will typically not see the content of the webpage or URL being called inside the iframe.

    If have a screen reading software, go to the URL above and see what your results are. BTW: Microsoft Narrator (the Windows built-in) is not a true screen reader, so do not use it.

    Hope this helps your understanding.

    Best Regards,
    Dennis Hall

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    I know what an iframe is but the point still remains that, framed or not, anyone visiting your site (as you describe it) will have to suffer audio on entry. And that's a really big problem.

    If it helps, I'm a professional developer with 13 years experience - specialising in accessible web design.

  11. dennishall
    Member
    Posted 2 years ago #

    Hi esmi:
    This site is built in accordance of the wishes of those people I respect in our community. The musicians want the site to operate this way specifically because it answers the needs of their audience.

    Thank you for you feedback.

    phillbooth:
    Thanks you for your willingness to assist with my effort.

    Best Regards,
    Dennis Hall

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    Then please be aware that the site may fall foul of web accessibility legislation.

Topic Closed

This topic has been closed to new replies.

About this Topic