Skip to content

Commit

Permalink
remove compression as it doesnt work
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-mescudi committed Jan 5, 2025
1 parent f402ca8 commit 92918e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
25 changes: 4 additions & 21 deletions audio.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package stegano

import (
c "github.com/scott-mescudi/stegano/compression"
u "github.com/scott-mescudi/stegano/pkg"
)

Expand All @@ -17,12 +16,8 @@ func (s *AudioEmbedHandler) EmbedDataIntoWAVWithDepth(audioFilename, outputFilen
return err
}

newdata, err := c.CompressZSTD(data)
if err != nil {
return err
}

buffer = u.EmbedDataWithDepthAudio(buffer, newdata, bitDepth)
buffer = u.EmbedDataWithDepthAudio(buffer, data, bitDepth)

err = WriteAudioFile(outputFilename, decoder, buffer)
if err != nil {
Expand All @@ -45,12 +40,8 @@ func (s *AudioExtractHandler) ExtractDataFromWAVWithDepth(audioFilename string,
}

data := u.ExtractDataWithDepthAudio(buffer, bitDepth)
newdata, err := c.DecompressZSTD(data)
if err != nil {
return nil, err
}

return newdata, nil
return data, nil
}

// EmbedDataIntoWAVAtDepth embeds compressed data into a WAV file at a specified bit depth.
Expand All @@ -65,12 +56,8 @@ func (s *AudioEmbedHandler) EmbedDataIntoWAVAtDepth(audioFilename, outputFilenam
return err
}

newdata, err := c.CompressZSTD(data)
if err != nil {
return err
}

buffer = u.EmbedDataAtDepthAudio(buffer, newdata, bitDepth)
buffer = u.EmbedDataAtDepthAudio(buffer, data, bitDepth)

err = WriteAudioFile(outputFilename, decoder, buffer)
if err != nil {
Expand All @@ -93,10 +80,6 @@ func (s *AudioExtractHandler) ExtractDataFromWAVAtDepth(audioFilename string, bi
}

data := u.ExtractDataAtDepthAudio(buffer, bitDepth)
newdata, err := c.DecompressZSTD(data)
if err != nil {
return nil, err
}

return newdata, nil
return data, nil
}
2 changes: 1 addition & 1 deletion methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type SecureExtractHandler struct {
type AudioEmbedHandler struct {}
type AudioExtractHandler struct {}

func NewAudioEmbedder() *AudioEmbedHandler {
func NewAudioEmbedHandler() *AudioEmbedHandler {
return &AudioEmbedHandler{}
}

Expand Down

0 comments on commit 92918e0

Please sign in to comment.