-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_freesound_api.sh
More file actions
executable file
·50 lines (40 loc) · 1.7 KB
/
test_freesound_api.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.7 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
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Test Freesound API manually before building the extension
echo "🌐 Testing Freesound.org API access..."
API_KEY="${FREESOUND_API_KEY:-YOUR_API_KEY_HERE}"
if [ "$API_KEY" = "YOUR_API_KEY_HERE" ]; then
echo ""
echo "⚠️ You need a Freesound API key first!"
echo ""
echo "1. Go to: https://freesound.org/apiv2/apply/"
echo "2. Fill out the form:"
echo " - Application Name: Bitwig Sample Browser Extension"
echo " - Description: Native Linux sample browser for Bitwig Studio"
echo " - Application URL: https://github.com/your-username/bitwig-sampler-plugin"
echo "3. Export your key: export FREESOUND_API_KEY='your_key_here'"
echo "4. Run this script again"
echo ""
exit 1
fi
echo "🔍 Testing search API..."
echo "Query: 'kick drum' samples"
echo ""
curl -s "https://freesound.org/apiv2/search/text/?query=kick%20drum&token=$API_KEY&fields=id,name,duration,tags,username,previews&page_size=5" \
| python3 -m json.tool \
| head -30
echo ""
echo "🔍 Testing specific sample details..."
# Get first sample ID from search
SAMPLE_ID=$(curl -s "https://freesound.org/apiv2/search/text/?query=kick&token=$API_KEY&fields=id&page_size=1" \
| python3 -c "import json,sys; data=json.load(sys.stdin); print(data['results'][0]['id'] if data['results'] else 'none')")
if [ "$SAMPLE_ID" != "none" ]; then
echo "Sample ID: $SAMPLE_ID"
echo ""
curl -s "https://freesound.org/apiv2/sounds/$SAMPLE_ID/?token=$API_KEY&fields=id,name,duration,tags,license,download" \
| python3 -m json.tool
echo ""
echo "✅ API test complete!"
echo "🎵 Ready to integrate into Bitwig extension!"
else
echo "❌ No samples found - check API key"
fi