Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Aug 9, 2023
1 parent 797fdfc commit 09784b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/wahwah/riff_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def parse_fmt_chunk(chunk)
@bitrate = @sample_rate * @channel * @bit_depth / 1000

# There is a rare situation where the data chunk is not included in the top RIFF chunk.
# In this case, the duration can be got from the data chunk, some player event cannot play the file.
# So try to estimate the duration from the bitrate.
# In this case, the duration can not be got from the data chunk, some player even cannot play the file.
# So try to estimate the duration from the file size and bitrate.
# This may be inaccurate, but at least can get approximate duration.
@duration = (@file_size * 8) / (@bitrate * 1000).to_f if @duration.nil?
end
Expand Down

0 comments on commit 09784b2

Please sign in to comment.