Opened 8 years ago

Closed 8 years ago

#8 closed enhancement (fixed)

Turn IExporter.process() into a generator

Reported by: olivier Owned by: yomguy
Priority: major Milestone: Version 0.3
Component: Export Version:
Keywords: Cc:


Please make the process() method a generator (or return an iterator object), for enabling real-time operations. The source file should be encoded in real time, using an internal buffer, and a chunk of encoded data returned each time <iterator>.next() is called (remark: next() is called transparently by "for" loops and others).

Example usage:

stream = exporter.process(1234, 'foobar.wav', {}, {})
for chunk in stream:

You might transparently cache the returned data to avoid encoding each time process() is called with identical parameters.

Change History (5)

comment:1 Changed 8 years ago by olivier

  • Type changed from defect to enhancement

comment:2 Changed 8 years ago by olivier

I've had new ideas about the cache: I think it must be handled by an external module. So please don't implement caching. For now, you can simply encode every time process() is called.

comment:3 Changed 8 years ago by olivier

  • Owner changed from yomguy to olivier

comment:4 Changed 8 years ago by yomguy

  • Owner changed from olivier to yomguy

comment:5 Changed 8 years ago by yomguy

  • Resolution set to fixed
  • Status changed from new to closed

Made all exporters generators.
Input audio raw data is now passed into sox while encoding (no decoding needed anymore...).

Note: See TracTickets for help on using tickets.