you do not expose real file paths, only urls.

1) You do not put your files under upload (SQLFORM does that), so I am
going to assume you move the two files under 'static'

2) the code should be

wav_file=URL(r=request,c='static',f='test.wav')
mp3_file=URL(r=request,c='static',f='test.mp3')

now this will work:

def test_embed():
    embed_wav=XML('<embed src="%s" autoplay="false" loop="false" />' %
wav_file)
    embed_mp3=XML('<embed src="%s" autoplay="false" loop="false" />' %
mp3_file)
    return dict(wav=embed_wav,mp3=embed_mp3)

Massimo

On Jun 28, 5:33 pm, weheh <[email protected]> wrote:
> This seems like it should be trivial, but I can't seem to get web2py
> to play an audio file. If my audio file is
>
> wav_file="c:/web2py/applications/test/uploads/test.wav"
> mp3_file="c:/web2py/applications/test/uploads/test.mp3"
>
> Then why doesn't this controller work?
>
> def test_embed():
>     embed_wav=XML('<embed src="%s" autoplay="false" loop="false" />' %
> wav_file)
>     embed_mp3=XML('<embed src="%s" autoplay="false" loop="false" />' %
> mp3_file)
>
>     return dict(wav=embed_wav,mp3=embed_mp3)
>
> I've gotten fancier, too, using the odeo audio player, but it doesn't
> work either. Do I need to be doing something with response.stream
> (wav_file)?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to