跳到正文
DEV Community· Krishna Sarkar·· 3 小時前AI 評分31

TrailEcho:開源 AI 聲景與捉鬼伴侶

TrailEcho: Open-Source AI Soundscape & Ghost Hunting Companion

AI 導讀

TrailEcho 擴展為夜間音訊伴侶和超自然異常調查工具,以即時音訊頻譜分析偵測異常頻率,並用開源權重 AI 將聲音模式轉化為哥德式敍事。它透過 Ollama 在本機執行 Gemma 2B 或 Llama 3.2 1B,並支援離線運作,不會把個人音訊傳送至雲端伺服器。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine


👻 TrailEcho: Open-Source AI Soundscape & Ghost Hunting Companion

"In the dead of night, every rustle of dry leaves and gust of cold wind sounds like a presence. What if your phone could listen, filter the natural ambient frequencies, and converse with the anomalies?"


🎃 The Spooky Inspiration: Ghost in the Machine

Two weeks ago during an autumn trail trek after dusk, the silence of the woods felt heavier than usual. The canopy creaked, cold mist settled over the clearing, and faint harmonic hums echoed between the hills. In folklore, these are the "liminal spaces" where the veil between the known and unknown thins out.

For Hacktoberfest 2026 Open-Source AI Challenge Week 4: Ghost in the Machine, I expanded my open-source offline field guide, TrailEcho, into a nocturnal audio companion and paranormal anomaly investigator.

Instead of cheap jump scares, TrailEcho (Ghost in the Machine Edition) uses open-weight AI and real-time audio spectral decomposition to transform ambient environmental audio into eerie, poetic soundscapes and spectral transcriptions — running 100% locally on your machine or edge device without sending personal audio to any centralized cloud server.


🌟 What TrailEcho Does

  1. Spectral Acoustic Anomaly Detection: Real-time Fast Fourier Transform (FFT) analysis on microphone input to detect unexplained frequencies, sudden subsonic rumbles (<20 Hz), and ultrasonic fluctuations.
  2. EVP (Electronic Voice Phenomena) Filter: An open-source Python audio filter pipeline that extracts hidden voice-like resonance from white noise and wind gusts.
  3. Open-Source AI Medium ("The Machine Ghost"): Uses local open-weight LLMs (via Ollama / llama.cpp / Gemma 2B) to interpret cryptic acoustic patterns into atmospheric gothic narratives, local folklore interpretations, or Victorian ghost-hunter logs.
  4. Offline Sensory Immersion ("Pocket Mode"): Turn your screen completely off. TrailEcho vibrates with subtle haptic rhythms when acoustic thresholds spike and whispers synthesized audio observations directly into your headphones.

🔗 Verified Project Links


🛠️ System Architecture & Tech Stack

+-------------------------------------------------------------+
|                      TRAILECHO RUNTIME                      |
|                                                             |
|   [ Microphone / Audio Input ]                              |
|                 │                                           |
|                 ▼                                           |
|   [ SciPy / NumPy FFT Spectral Filter ]                     |
|                 │                                           |
|       ┌─────────┴─────────┐                                 |
|       ▼                   ▼                                 |
|  [ Subsonic/EVP Band ]  [ Ambient Noise Reducer ]           |
|       └─────────┬─────────┘                                 |
|                 ▼                                           |
|   [ Local Open-Weight LLM (Ollama / Gemma 2 / Llama 3.2) ]  |
|                 │                                           |
|                 ▼                                           |
|   [ Piper / Coqui Local Neural TTS ]                        |
|                 │                                           |
|                 ▼                                           |
|   [ Binaural Audio Output / Haptic Feedback ]               |
+-------------------------------------------------------------+

Core Technologies

  • Python 3.11+ & NumPy/SciPy: High-performance audio signal processing, bandpass filtering, and spectral density calculations.
  • Open-Weight AI: Gemma 2B / Llama 3.2 1B running locally via Ollama with zero cloud API latency or dependency.
  • Piper TTS: Fast, lightweight local neural text-to-speech with gothic/haunted voice timbres.
  • Zero Cloud Footprint: Absolutely zero data leaves your local device.

💡 Why Open Innovation Matters for Haunted Audio

Closed-source cloud models fail in three fundamental ways for field applications:

  1. Zero Connectivity in the Dark: When you are deep in an old forest or historic ruin at midnight, there are no 5G towers. A proprietary cloud model is completely useless when you need it most.
  2. Audio Privacy & Intimacy: Ambient audio recordings capture private conversations, breathing, and intimate surroundings. Feeding raw field recordings into opaque corporate surveillance databases is a massive privacy hazard. Open-source local inference guarantees your acoustic privacy is inviolable.
  3. Total Creative Control: Proprietary models are heavily sanitised and refuse to engage with gothic, folklore, or eerie atmospheric roleplay. With open weights, we can steer temperature, system personas, and creative boundaries freely.

🧪 Code Snippet: Real-Time Anomaly Bandpass & Local Prompting

import numpy as np
from scipy.signal import butter, sosfilt
import requests

def detect_spectral_anomaly(audio_chunk, sample_rate=44100):
    """Detects unexpected spectral density deviations in EVP bands (300-3000 Hz)."""
    sos = butter(4, [300, 3000], btype='bandpass', fs=sample_rate, output='sos')
    filtered = sosfilt(sos, audio_chunk)
    energy = np.sqrt(np.mean(filtered**2))

    # Anomaly threshold trigger
    if energy > 0.085:
        return True, energy
    return False, energy

def consult_machine_ghost(energy_level, duration_sec):
    """Prompts local open-weight model via Ollama with atmospheric guardrails."""
    prompt = f"The EVP detector registered acoustic resonance at {energy_level:.3f} for {duration_sec}s in total darkness. In 2 atmospheric gothic sentences, describe what presence lingered in the soundscape."

    response = requests.post("http://localhost:11434/api/generate", json={
        "model": "gemma2:2b",
        "prompt": prompt,
        "stream": False
    })
    return response.json().get("response", "")

🎃 Happy Halloween & Hacktoberfest 2026!

Building for Hacktoberfest 2026 has been an exhilarating journey across open-source AI, edge computing, and creative community hacking. Huge thanks to DEV, DigitalOcean, and MLH for organizing an incredible celebration of open software.

Go out into the twilight, put your phone in Pocket Mode, and listen to what the machine hears. 👻🌲

來源:DEV Community · dev.to