Skip to content

exelerus/app-audioinput-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logotype

app-audioinput-demo

Demonstration apps for the cordova-plugin-audioinput v2.0 plugin, showcasing both Cordova and Capacitor implementations.

🎯 What's New in v2.0

This demo repository now includes two complete demo applications:

  1. Cordova Demo (root directory) - Classic Cordova implementation
  2. Capacitor Demo (capacitor-demo/) - Modern React + TypeScript implementation

Both demos showcase the same plugin features but with different architectures and technologies.

πŸ“¦ Demo Apps

Cordova Demo (Traditional)

Location: Root directory Technologies: Vanilla JavaScript, HTML, CSS Platforms: Android, iOS, Browser

Features:

  • 4 demo modes: Events, Web Audio, WAV, File Recording
  • Updated to latest Cordova platforms (Android 14.0, iOS 7.1.1)
  • Modern dark theme UI with CSS animations
  • Memory leak fixes and performance improvements
  • ES6+ JavaScript with arrow functions and modern syntax

Getting Started:

# Install dependencies
npm install

# Add platforms (versions will be pulled from package.json)
cordova platform add android
cordova platform add ios

# Or add specific versions
cordova platform add android@14.0.0
cordova platform add ios@7.1.1

# Run on Android
cordova run android

# Run on iOS
cordova run ios

Capacitor Demo (Modern)

Location: capacitor-demo/ Technologies: React 19, TypeScript 5, Vite 7, Capacitor 7 Platforms: Android, iOS, Web

Features:

  • Modern React + TypeScript architecture
  • Component-based demos with type safety
  • Beautiful gradient UI with animations
  • Vite for fast development and builds

Getting Started:

cd capacitor-demo

# Install dependencies
npm install

# Development mode
npm run dev

# Build and sync
npm run build
npx cap sync

# Open in Android Studio
npx cap open android

# Open in Xcode
npx cap open ios

πŸš€ Features Demonstrated

Both demo apps showcase:

  1. Events Demo - Capture raw audio data and process with Web Audio API
  2. Web Audio Demo - Direct AudioNode streaming to speakers
  3. WAV Demo - Encode captured audio to WAV format
  4. File Demo - Record and save audio files to device storage

πŸ“± Supported Platforms

  • Android 5.0+ (API 22+)
  • iOS 13.0+
  • Browser (limited features)

πŸ”§ Plugin Features (v2.0)

  • Real-time microphone capture
  • Multiple audio sources (Default, Camcorder, Unprocessed, Voice Communication, etc.)
  • Configurable sample rates and buffer sizes
  • Web Audio API integration
  • File recording with WAV encoding
  • Permission handling
  • TypeScript definitions (Capacitor)
  • Promise-based API (Capacitor)
  • Event-based API (Cordova)

πŸ“ Changelog (v2.0)

Cordova Demo Updates

  • βœ… Updated to cordova-plugin-audioinput v2.0.0
  • βœ… Updated Android platform to 14.0.0 (from 7.0.0) - Targets Android 15/SDK 35
  • βœ… Updated iOS platform to 7.1.1 (from 4.5.4)
  • βœ… Updated cordova-plugin-file to 8.1.3
  • βœ… Removed deprecated plugins (cordova-plugin-compat, cordova-plugin-splashscreen)
  • βœ… Removed external CSS dependencies (W3.CSS)
  • βœ… Fixed memory leaks in events and file demos
  • βœ… Fixed typos in error messages
  • βœ… Complete CSS overhaul with modern dark theme
  • βœ… Modernized JavaScript with ES6+ syntax (const/let, arrow functions, template literals)
  • βœ… Added visual feedback and status indicators
  • βœ… Removed icon/splash screen configurations (simpler demo setup)

Capacitor Demo (New!)

  • ✨ Brand new React + TypeScript demo app
  • ✨ Modern component-based architecture
  • ✨ Beautiful gradient UI design
  • ✨ Type-safe AudioInput API
  • ✨ Vite for fast development
  • ✨ Ready for Android and iOS

πŸ› οΈ Development

Cordova Demo

The Cordova demo uses traditional web technologies and is located in the root directory:

www/
β”œβ”€β”€ index.html           # Main menu
β”œβ”€β”€ events-demo.html     # Events demo
β”œβ”€β”€ webaudio-demo.html   # Web Audio demo
β”œβ”€β”€ wav-demo.html        # WAV encoding demo
β”œβ”€β”€ file-demo.html       # File recording demo
β”œβ”€β”€ css/
β”‚   └── app.css         # Enhanced styles
└── js/
    β”œβ”€β”€ events-demo.js
    β”œβ”€β”€ webaudio-demo.js
    β”œβ”€β”€ file-demo.js
    β”œβ”€β”€ wav-demo.js
    └── utils.js

Capacitor Demo

The Capacitor demo is a modern React app with TypeScript:

capacitor-demo/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.tsx              # Main app with navigation
β”‚   β”œβ”€β”€ App.css              # Modern gradient styles
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ EventsDemo.tsx
β”‚   β”‚   β”œβ”€β”€ WebAudioDemo.tsx
β”‚   β”‚   β”œβ”€β”€ WavDemo.tsx
β”‚   β”‚   └── FileDemo.tsx
β”‚   └── main.tsx
β”œβ”€β”€ android/                 # Android platform
β”œβ”€β”€ capacitor.config.ts      # Capacitor config
β”œβ”€β”€ package.json
└── tsconfig.json

🀝 Contributing

This project is open-source, and contributions are welcome! Please ensure your changes maintain backward compatibility.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License

πŸ‘ Credits

  • Created by: @edimuj
  • App icon: @richardbmx

Contributors

πŸ”— Links