Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:48:38+00:00 2026-06-09T16:48:38+00:00

I have some sound files in a couchdb database (not related to web2py) .

  • 0

I have some sound files in a couchdb database (not related to web2py). My web2py application has access to this database, and I want to stream the sound files so that they can be listened with the HTML audio tag, like this:

<audio src="http://www.myserver.com/.../track06.mp3" preload="auto"></audio>

I am planning to do this streaming based on this suggested example:

def streamer():
    import os
    path=os.path.join(request.folder,'private','largefile.mpeg4')
    return response.stream(open(path,'rb'),chunk_size=4096)

But I have some open questions:

  1. My filename is not in the local filesystem, but in a couchdb database, accessible via REST. How can I open that for streaming?
  2. What kind of request will the audio tag send when it is activated, GET/POST/…? Can this be handled with web2py?

Basically, I would like to know if somebody has a working example of streaming couchdbattachments via web2py.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:48:39+00:00Added an answer on June 9, 2026 at 4:48 pm

    The solution I am using now is this:

    def open_remote_recording():
        recording_doc_id, recording_id = tuple(request.args)
        url = get_doc_url(server = RECORDINGS_SERVER, database = RECORDINGS_DATABASE, doc_id = recording_doc_id, attachment = recording_id)
        content_type = 'audio/mp3'
        f = urllib.urlopen(url)
        return f
    
    @auth.requires_login()
    def recordings():
        f = open_remote_recording()
        return response.stream(f, chunk_size=4096)
    

    The get_doc_url function is just creating a url to access the attachment.
    The content_type is fixed, but this should be obtained from the attachment (I do not yet know how to do this).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some business requirements which sound something like this: Find the data in
I have some files, sound files (.wav and .mp3) and text files (.rtf), in
Hopefully someone has been down this road before and can offer some sound advice
with iphone SDK 4.0 i want to use some system sound files eg /System/Library/Audio/UISounds/dtmf-0.caf
I know this sounds confusing: I have just built some basic prev/next pagination for
I have some arbitrary pixel data that I want to save as a PNG.
I have some audio files on my http server, and I would like to
I am new to scons and have been trying to build some files, in
this is some kind of long post, so I have to say thanks for
I hate to sound stupid, but ASP.NET is not my forte. I have build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.