-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_ghostvault.py
More file actions
38 lines (32 loc) · 1.16 KB
/
test_ghostvault.py
File metadata and controls
38 lines (32 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
"""Simple test script for GhostVault functionality."""
import os
import sys
from PIL import Image
import numpy as np
import wave
def create_test_image():
"""Create a simple test image."""
img_array = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
img = Image.fromarray(img_array)
img.save("test_image.png")
print("Created test_image.png")
def create_test_audio():
"""Create a simple test audio file."""
sample_rate = 44100
duration = 1 # 1 second
samples = np.random.randint(-32768, 32767, sample_rate * duration, dtype=np.int16)
with wave.open("test_audio.wav", 'wb') as wav_file:
wav_file.setnchannels(1) # Mono
wav_file.setsampwidth(2) # 2 bytes per sample
wav_file.setframerate(sample_rate)
wav_file.writeframes(samples.tobytes())
print("Created test_audio.wav")
if __name__ == "__main__":
print("Creating test files for GhostVault...")
create_test_image()
create_test_audio()
print("\nTest files created! You can now test GhostVault with:")
print("- test_image.png")
print("- test_audio.wav")
print("\nRun: python ghostvault.py")