×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    3

    Question _recorder.pyd source / playing audio data

    Dear All

    I'd like to generate audio data on the fly and play it out. To do this I need to be able to write a subclass of audio.Sound() that can use raw data instead of file names. However, the relevant parts of audio.Sound() (i.e., open() and play()) are just wrappers around _recorder.Player(). _recorder is a .pyd file (in C:\sys\bin). Does anyone know:

    - if/how I can read the source code for _recorder.pyd?

    - any other way to play raw data across audio?

    All comments welcome.

    Thanks

    Ivan

  2. #2
    Registered User
    Join Date
    May 2008
    Posts
    6

    Re: _recorder.pyd source / playing audio data

    I'd like to feed the audio from memory too, so that you could stream audio from the internet...

    The source for recoder.pyd is probably in sourcecode zip available at sourceforge. http://sourceforge.net/project/showf...roup_id=154155

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: _recorder.pyd source / playing audio data

    Hi Ivan and welcome to the Python discussion board.

    I'm not sure I understand your requirement so I apologise if this is not related to it, but I think you should check out this article about generating/playing sounds in PyS60.

    Hope that helps

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    3

    Re: _recorder.pyd source / playing audio data

    Shadowjk, Bogdan

    Thank you for your fast comments. I'm a little bit further forward.

    I've found the source for _recorder.pyd (src/ext/recorder/). It looks like to do anything here I would have to write in C++ and tackle CMdaAudioPlayerUtility. For now I'd rather build a wav file out of raw data, write the file and then play it. That's a horrible kludge but it meets my immediate requirements.

    I've had a quick look at smidi.py. It looks interesting and it may be useful ... if it can handle recorded speech data ...

    What I want to do is concatenate data from separate audio files, and play the result. The application is very basic limited vocabulary speech synthesis. I'm writing my own instead of using audio.say() for language and quality reasons. The application works on vanilla python (ie on PC).

    A concrete example: A robot greeter in a company hallway, which says "Hello <person's name>" when someone enters the building. The greet function will look like this:

    Code:
    def greet(name):
        hello = open('hello.raw').read()
        name = open('%s.raw' % name).read()
        data = hello + name
        w = makeWaveWriteObj(data) # exercise for the reader
        play(w) # platform dependent eg use PyAudio on PC
    It seems that for a PyS60 version of this function, makeWaveWriteObj would have to write an audio file and return the filename. I'm looking for a way to just agglomerate the data and send it straight to audio (like I can on PC).

    All the best

    Ivan

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    3

    Re: _recorder.pyd source / playing audio data

    Quick note: the concatenate/write/play method works. The better way to do it will probably have to wait until I really need it (or until someone else does.

    Thank again for your help.

    Best

    Ivan

Similar Threads

  1. Player p becomes null after it has started playing audio
    By sanket2612 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-02-15, 19:21
  2. No rule to make target
    By ckt in forum Symbian
    Replies: 5
    Last Post: 2007-10-11, 20:34
  3. Error with makesis.exe and creating the .pkg file
    By gramya87 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2007-10-10, 13:53
  4. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37

Posting Permissions

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