Results 1 to 5 of 5

Thread: Record and Play Back Audio within Website

  1. #1
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default Record and Play Back Audio within Website

    I need what seems like a very basic setup, but has turned out to be a complete problem in every way. I have been working on this (now and then) for well over a month and now nonstop for about 2 days. I have found nothing that works in a real cross-browser environment.


    There are only two requirements:
    1. Users can go to a page on my site and hit a record button and click upload.
    2. Those files can be played back also on my site.


    I found a Java applet that records audio and submits it to the website. This is good and works for what I need.
    It can submit in a few formats, but basically it's going to be a standard codec in .wav [even uncompressed if that is necessary]


    I then need to find a way to play it back to the user (with controls).
    As we all know this can be difficult to make fully cross browser, so I have tried the following:
    1. Quicktime:
    Though this used to be a standard method for embedding, the mac vs. pc war has now reached a state of complete idiocy:
    On Windows 64 bit machines, the play controls for embedded QT plugins are black. Yes, that's right-- apple has not fixed this (it's a known issue) and so quicktime is out, unless you have an alternate solution for any Windows 64bit user.


    2. Flash:
    This seems like the answer. But flash only supports mp3 (and aac?). Theoretically other formats are possible (especially with the newest versions of flash), but there are no players available for them.
    Of course we could convert it with a program, but this needs to be dynamic: they upload, then they can play it. Done.


    3. The only flash wav player I could find:
    http://blog.datacompboy.ru/2009/11/2...vplayer-1-6-1/
    Sorry, it's in Russian.
    http://blog.datacompboy.ru/u/WavPlayer/sample.html
    There's a demo.
    This actually WORKS! but for some reason it crashes Internet Explorer. I don't know how to fix it.
    So, back to where we started. Nothing.


    4. Convert uploaded .wav to .mp3?
    LAME is a library that does just that: but it appears to be a legal gray area and it also requires a dedicated server to install (assuming everything does go well).


    5. Upload using Flash?
    But of course there's something wrong with this too: the only way flash will upload is to a streaming server, for which the software costs $4500 from Adobe. Of course there is an open source version floating around out there, but it requires also a dedicated server, and some sort of front end that I can't code (and seems to be at least $100 to buy).
    Then there are format issues with this and playing it back means being stuck in the proprietary codec within flash (nellymoser) which costs over $7000 to get a license to use. There are again open source workarounds, but this seems messy.
    Then there's still the issue of playing it back, but at this point I suppose we'd have something that would work in flash.




    The goals:
    While not every user necessarily needs to be able to upload using the website, because they can just upload a pre-recorded wav file, every user needs to be able to listen to the file.
    For this reason a Java applet (which is not perfect, but works at least) is ok, because there are alternatives.
    But I don't want something that messy for the playback.
    In fact, the Java applet has a player option, but I'd like to not require Java for users who are just playing back the audio.



    Note: the reason I need this is to setup a site where users can have voice messages in their profile. (It's a bit more complex than that, but from there I can figure out the rest once PHP can start doing it's job.)


    I've looked at this from every angle (I think), and I can't find any good solutions, so just suggest somewhere to start if you know.
    I'd be willing to pay something for this, but I don't have a $1000+ budget like is required for the professional solutions.

    If someone wants to create something (for example, a flash player) that will serve my purposes, we could negotiate a fee (something like $100?) if it covers everything.
    The most basic solution would be a working flash player (or debugging the Russian one above) that plays wav files.


    There may be a "best" solution to this (perhaps paying a lot of money for something) for the future, but for the launch of the site I just want it to work for everyone. After that, we can move on to figuring out the best approach and keeping filesize down, etc.


    Again, the current status is that using the Russian flash player above I can play uncompressed wavs using the Java uploader in every browser except internet explorer, which either crashes or just does nothing.


    Note: these sound files will not be long. I would like at least 1 minute (maximum), and certainly never anything more than 3-5 minutes.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  2. #2
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    Ben asked me if I had any ideas about this. Honestly, I'd use your Java applet to record/upload wav files and then use LAME to encode to mp3.

    With the "legal" issues behind LAME:
    LAME is released under GPL 2.0 along with the MPG123 encoder it uses which means you are free to use these in any open source project you complete, regardless of the "intended purpose" that the LAME project lists as educational. GPL 2.0 doesn't allow for specifying uses for the software. You can learn more about the license specifics here

    Yes, it does require that the server have root access, but not specifically "dedicated" as it could be cloud based or VPS with Virtuozzo optimized. Basically, ability to access root.

    But then again, that's just my humble opinion...

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Thank you for the response.

    Currently, root access is not possible. Upgrading to a dedicated server is one of the future plans for the site, but hopefully something for a bit later. If absolutely required (and everything else works out) it may be possible to do that now.

    Using LAME then sounds like an option, but in this case the result will not be open source (at least I don't think it would be seen as such). I am building a website, not a "program", and my PHP code will not be made available. It's not that I'm hiding anything, but that is another dimension to the project (sharing it) that I don't want to add. Specifically for LAME I would probably use an existing class (which would be open source). Is this then reasonable?

    ---
    Continuing research on playing wavs in flash:

    http://code.google.com/p/popforge/so...state%3Dclosed

    How difficult would it be for someone to build a reliable player that can play wav files (under 2mb) without much difficulty in at least IE and FF (mac/pc)?
    The code above might help or the Russian example above.

    I don't know why the code is unreliable, so there may be a more fundamental problem than just adding a few buttons and attaching actions. I don't know flash (beyond the very basics), so I'm not sure where to start with that.


    EDIT: Here's one with some source code. This may be helpful if it ends up working (though the UI is very different than desired).
    http://etcs.ru/pre/WAVPlayer/srcview/
    Last edited by djr33; 01-31-2010 at 08:44 AM.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    First off, I am not a Flash person -- I have never learned action script and every time I try, I just realize why I don't like using it so I can't tell you how hard it would be to edit the two options you found, although, for someone experienced with flash, it's bound to be fairly simple as all you would need to do is edit the interface on that last one.

    As far as LAME goes, that honestly makes it all the better (with the issue of root access aside). If you are just going to use LAME in its existing form and call it to do some encoding then a simple notice on the page (with link to the LAME project)stating you are using LAME should satisfy GPL. But if you even wanted to make overly sure, you could always put the code that actually calls LAME in its own PHP file, include it on the main page, then just stick the PHP page with your LAME calls in a Google Code repository and add a GPL license notice on it and you would be more than fine. But I honestly think that is a bit much.

    Understanding that you are looking for a solution that doesn't require root access, I'd find someone who if familiar with flash and get them to edit that player you found so the interface is a little nicer.(Assuming its open source of course)

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ok, thanks for the feedback. I will look at both possibilities.
    I realized also that there is an advantage of mp3: its format is reliable. We might get wavs running, but certainly not all wavs so that would mean that users uploading their own files would have to figure out the details of the wav format rather than just click the "mp3" button.
    That last example has the source listed and the project file: I assume this means it's available to use/modify.

    Now, to find a flash person or continue looking on google for an answer.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •