-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send audio preview #803
Send audio preview #803
Conversation
window.URL.revokeObjectURL url | ||
reject new Error('Exceeded video load timeout') | ||
, 100 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might wanna reject on error?
, 100 | ||
|
||
_is_video: (file) -> | ||
file?.type?.startsWith 'video' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
underscore is used mostly to used mark private functions
.idea/codeStyleSettings.xml
Outdated
<JSCodeStyleSettings> | ||
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" /> | ||
</JSCodeStyleSettings> | ||
<TypeScriptCodeStyleSettings> | ||
<option name="SPACE_AFTER_TYPE_COLON" value="true" /> | ||
</TypeScriptCodeStyleSettings> | ||
<XML> | ||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont need to mention that i am not a big fan of committing the ide files :/
|
||
_normalise_sample: (value) -> | ||
MAX_VALUE = 255 | ||
Math.min(Math.abs(parseInt(value * MAX_VALUE, 10)), MAX_VALUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could even move into NumberUtil, its totally generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[0...5] will exclude the end
window.setTimeout -> | ||
window.URL.revokeObjectURL url | ||
reject new Error('Exceeded image load timeout') | ||
, 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will resolve and reject. whats the idea behind the timeout
file?.type?.startsWith 'image' | ||
|
||
_generate_preview: (audio_buffer) -> | ||
MAX_SAMPLES = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe get_normalized_loudness ?
for bucket, index in buckets | ||
preview[index] = @_normalise_sample(@_root_mean_square(bucket) * AMPLIFIER) | ||
break # only select first channel | ||
new Uint8Array(preview) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you will use only the left channel for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't commit changes in yarn.lock
.
z.assets.AssetMetaDataBuilder.build_metadata file | ||
.then (metadata) -> | ||
asset = new z.proto.Asset() | ||
if z.assets.AssetMetaDataBuilder.is_audio(file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if z.assets.AssetMetaDataBuilder.is_audio file
.idea/codeStyleSettings.xml
Outdated
@@ -43,4 +43,4 @@ | |||
</option> | |||
<option name="USE_PER_PROJECT_SETTINGS" value="true" /> | |||
</component> | |||
</project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL
# Wait before removing resource and link. Needed in FF | ||
window.setTimeout -> | ||
window.URL.revokeObjectURL url | ||
, 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can get rid of this timeout. it was only valid when you actually download a file using the link approach
Type of change
Sends audio preview when uploading audio data
Adds builder to construct various types of MetaData
Screenshot