Skip to content
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

Replace IntToBytes with AppendInt #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hollowness-inside
Copy link

@hollowness-inside hollowness-inside commented Apr 23, 2024

Append to the output buffer directly. This eliminates the need to intermediately allocate additional memory to keep int16 and int32 as bytes.

@@ -134,6 +129,7 @@ func rescaleFrame(s Frame, bits int) int {
}

func fmtToBytes(wfmt WaveFmt) []byte {
<<<<<<< Updated upstream
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Committed by mistake?

@@ -144,14 +140,17 @@ func fmtToBytes(wfmt WaveFmt) []byte {
blockalign := int16ToBytes(wfmt.BlockAlign)
bitsPerSample := int16ToBytes(wfmt.BitsPerSample)

=======
b := make([]byte, 0, 23)
>>>>>>> Stashed changes
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants