m0j0hn / editor-on-fire

Automatically exported from code.google.com/p/editor-on-fire
Other
0 stars 0 forks source link

Support the marking of a song preview phrase #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This could be implemented by having somebody seek to where the preview should 
start, place a phrase marker, seek to where the preview should end and place 
another marker.

According to the Oggscissors website, OGG's smallest decode-able unit is around 
1024 audio samples (20ms).  This means that stream copying is going to be too 
inaccurate to use with this feature.  We might as well rip the raw samples and 
encode them to OGG.  For the sake of a preview, the quality loss from a double 
encode is going to be unimportant.

Original issue reported on code.google.com by raynebc on 22 Sep 2010 at 2:42

GoogleCodeExporter commented 9 years ago
My recommendation for this feature would be to have ALOGG decode the necessary 
audio samples into a buffer and to have that buffer encoded to preview.ogg.

Original comment by raynebc on 30 Sep 2010 at 8:25

GoogleCodeExporter commented 9 years ago
The Ogg Video Tools:
http://en.flossmanuals.net/TheoraCookbook/ManipulateOggTheoraFiles

includes a utility called oggCut, which should be able to easily suit this task.

Original comment by raynebc on 13 Oct 2010 at 6:56

GoogleCodeExporter commented 9 years ago
The eof_read_next_pcm_sample() function created for issue 173 would probably 
make it easy to decode a specific time range of the current audio:

1. Create a new ALOGG_OGG pointer (or re-use the one for EOF's chart audio), 
seek to the desired start time for the preview audio.
2. Create a SAMPLE buffer large enough to hold decoded PCM samples from the 
desired start to the end time (samplecount) for the preview audio.
3. Use eof_read_next_pcm_sample() to read samplecount * samplesize number of 
bytes into the SAMPLE buffer.
4. Save the SAMPLE buffer to a WAV file
5. Encode that WAV file to preview.ogg

Original comment by raynebc on 8 Nov 2010 at 8:46

GoogleCodeExporter commented 9 years ago
6. Fade the audio in and out at the beginning and end of the preview.  This 
should be pretty easy, as it only requires a small amount of math and scaling 
of the PCM samples.

Original comment by raynebc on 27 Dec 2010 at 5:13

GoogleCodeExporter commented 9 years ago
eof_read_pcm_samples() doesn't seem to function correctly, at least for a file 
that was opened with ALOGG.  Unless that can be made to work, or the OGG 
functions could be manipulated directly, it will be easiest to decode the 
entire track audio file to a SAMPLE buffer, copy the appropriate range of PCM 
samples to another SAMPLE buffer and encode the latter buffer to preview.ogg.

Original comment by raynebc on 9 Jan 2011 at 10:10

GoogleCodeExporter commented 9 years ago
thekiwimaddog indicated that preview.ogg would be more feasible than a 
start/stop time tag, because of the number of stems Phase Shift would have to 
possibly handle with the start/stop time method.

Original comment by raynebc on 29 May 2011 at 8:40

GoogleCodeExporter commented 9 years ago
For the GUI portion of this, it would probably be easiest to have "set preview 
start" and a "set preview end" functions that will take the current seek 
position into account (adjusted for AV delay).  When the start and end 
positions have been defined, a color strip can be rendered above the piano 
roll.  When the user opts to create the preview clip, the OGG can be decoded, 
the appropriate portion of the audio split into another buffer, manipulated for 
fade in/out and then encoded to OGG.

Original comment by raynebc on 17 Oct 2011 at 11:41

GoogleCodeExporter commented 9 years ago
As a start, when a start and stop point has been defined, the gray background 
of the editor track can be rendered in a different color (that contrasts with 
the various markings in the editor window) to identify the preview section.

Original comment by raynebc on 18 May 2012 at 11:35

GoogleCodeExporter commented 9 years ago
r1239 completes a dialog where the user can specify a start and stop timestamp 
to generate both WAV and an OGG format preview files in the project's folder.  
It may not be important to mark the editor window to reflect where the preview 
was created, but we'll see if users think it would be helpful.

Original comment by raynebc on 15 Nov 2013 at 7:45

GoogleCodeExporter commented 9 years ago
Marking the chart to indicate what portion of it was exported as the preview 
audio didn't seem to be something the users asked for, so this issue is 
probably close enough to being finished.

Original comment by raynebc on 25 Apr 2014 at 10:56