Forums

    7 posts

  • avatar
    0 sounds
    1 post
    Playing and stopping current sound


    Hey everyone I don't know if this has been posted somewhere but would it be possible to have a feature where when you are searching through sounds and playing them it stops the current sound you're playing like how audiojungle.net does? Instead of lots of sounds playing at the same time. If this was already posted apologies and thanks.

  • avatar
    2 sounds
    47 posts


    Looks to be simple bug in the Javascript on on Freesound.org. The file player.js ought to run stopAll() before playing.

    Free Sound admins: please add stopAll(); at line 280 in player.js.


    $(".play", this).bind("toggle", function (event, on)
    {
    if (on)
    {
    stopAll(); // <-- This is the line that needs to be added
    switchOn($(".play", playerElement));
    sound.play();
    }
    else
    {
    switchOff($(".play", playerElement));
    sound.pause();
    }
    });

    I know the sysadmins are busy, so I've written a GreaseMonkey script that you can run on your own computer that fixes it in the meantime. I'll post again once I have it uploaded somewhere.

    --b9

  • avatar
    2 sounds
    47 posts


    If your browser can handle UserScripts, here's one that will fix it so only a single sound will play at a time:

    https://greasyfork.org/en/scripts/40937-freesoundsingle

  • avatar
    255 sounds
    132 posts


    Whoa, this is not a defect, it's a feature!

    If you want the playing of a sound to stop, then stop it yourself.

    I love being able to bring up multiple sounds of a similar type and playing them all simultaneously with looped playback.

    So whatever you do, don't take away this feature. At most, make it an option on any page viewing sounds.

    --
    Keith W. Blackwell

    -- Keith W. Blackwell
  • avatar
    2 sounds
    47 posts


    zimbot wrote:
    Whoa, this is not a defect, it's a feature!
    If you want the playing of a sound to stop, then stop it yourself.

    I can see that point of view.

    I was showing a person new to freesound.org around the site the other day and he hadn't even realized that he was playing multiple sounds. When I told him he was, he couldn't see anywhere to click to stop the others (they had scrolled off the screen while he was browsing for sounds).

    I didn't want him to get too discouraged right away with freesound.org, so I pointed out that this site is unique in that it lets you play multiple sounds at once. ("It's a feature!") I can sort of imagine it being useful for hearing how two sounds meshed. (Though, if you're doing that, why not just use audacity which lets you shift the sounds so you can hear them playing at the right point in time?)

    The problem with telling people to just "stop it yourself", is that the web interface needs a lot more work if simultaneous playback is to be a genuine feature. At the least, there needs to be a blatantly obvious indication of what samples are currently playing. For example, a pop-up box in the corner showing a list of all looping tracks, preferably with stop buttons for each plus a "stop all" button.

    But that would take more work, coding the interface in javascript (using jQuery and soundManager).

    I hope that the freesound.org admins change the website to play only one sound at a time by default and then later add back in the multiplaying feature after someone has coded up a better solution than the current confusing default.

  • avatar
    702 sounds
    155 posts


    hackerb9 wrote:
    I hope that the freesound.org admins change the website to play only one sound at a time by default and then later add back in the multiplaying feature after someone has coded up a better solution than the current confusing default.

    I'm in the stance that the multi-play feature should remain, but I agree it could use improvements. Perhaps an easier solution would be to make the "Play/Pause" buttons on the boxes larger or more obvious, so that it is easier to distinguish between sounds that are playing and sounds that are paused.

    Another possible option is to have the background colour of the waveform view change if it is currently playing - though this might become a visual annoyance.

    A sort of "SoundCloud" interface as you suggested would be great, where it shows you what sounds are currently playing in a pop-up box at the bottom of the screen, where you can play, pause and remove the various sounds you've recently played, even potentially carrying across even while navigating through the site's pages.

  • avatar
    0 sounds
    1 post


    I also would like to have only one sound playing at a time.

    A very simple and flexible solution would be to just have a checkbox saying "Play only one song at a time" on the top of the page, for instance, which users could toggle according to their likes. The toggle, of course, should be persisted somewhere in the user's browser, like in a cookie, so that users' choice is remembered in the next visits.

    Another option would be to add a separate button into each sound's player that would stop playing the current sound and play the one you want. Like a "Stop all and Play". So all types of users would be happy to being able to choose whatever they want to do. smile

    Meanwhile, the script that hackerb9 posted works greatly! Thanks for that

    7 posts