Skip to content

Commit

Permalink
Added output as a file
Browse files Browse the repository at this point in the history
  • Loading branch information
ImTheCurse committed Dec 7, 2023
1 parent a24c8bf commit c526d16
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"request": "launch",
"mode": "debug",
"program": "${file}",
"args":["-audio=sample-file-2.wav","-tfile=toEncode.txt","-encode=true"]
"args":["-audio=input/sample-file-2.wav","-tfile=input/toEncode.txt","-encode=true"]
}

]
Expand Down
14 changes: 12 additions & 2 deletions Decode/decode.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Decode

import (
"fmt"
"log"
"os"

"github.com/go-audio/wav"
Expand Down Expand Up @@ -30,7 +30,17 @@ func Decode(fname string) {
}
}
decodedMessage += "\n"
fmt.Print(decodedMessage)

f, err := os.Create("results/dec_msg.txt")
if err != nil {
log.Fatal(err)
}
defer f.Close()

_, err2 := f.WriteString(decodedMessage)
if err2 != nil {
log.Fatal(err2)
}
}

func checkMarked(val int, prevVal int) bool {
Expand Down
Binary file modified enc_file.wav
Binary file not shown.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions input/toEncode.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It was food and drink to me to look
2 changes: 2 additions & 0 deletions results/dec_msg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
It was food and drink to me to look

1 change: 0 additions & 1 deletion toEncode.txt

This file was deleted.

Binary file modified wavSteg
Binary file not shown.

0 comments on commit c526d16

Please sign in to comment.