Skip to main content
Send an audio message (MP3 or WAV, up to 1 GB) to a channel. Mobile SDKs handle upload automatically, while web SDKs require a separate upload step before sending.

Audio Messaging Overview

Audio messages allow users to convey tone and detail that text cannot capture: voice notes, recordings, and spoken explanations.

Voice Expression

Voice communication
  • Convey tone and emotion naturally
  • Quick voice notes and responses
  • Detailed audio explanations
  • Personal touch in conversations

Format Support

Audio handling
  • MP3 and WAV format support
  • Up to 1GB file size capacity
  • Cross-platform compatibility

Platform Implementation

Unified audio handling with automatic uploadMobile SDKs provide streamlined audio messaging with automatic upload processing, eliminating the need for separate upload steps.

Required Parameters

ParameterTypeDescription
subChannelIdStringTarget subchannel identifier for the audio message
attachmentAudio/URILocal audio file path or URI reference

Optional Parameters

ParameterTypeDescription
captionStringText description or transcript for the audio
fileNameStringCustom filename for the uploaded audio
tagsArray<String>Message categorization and filtering tags
parentIdStringParent message ID for threaded conversations
metadataObjectCustom properties for extended functionality

Implementation Examples

// Create audio message with local file
let audioUrl = URL(fileURLWithPath: "/path/to/local/audio.mp3")
let options = AmityAudioMessageCreateOptions(
    subChannelId: "subChannel-123",
    attachment: .localURL(url: audioUrl),
    fileName: "voice_note.mp3",
    tags: ["voice-note", "quick-update"],
    parentId: nil
)

do {
    let message = try await messageRepository.createAudioMessage(options: options)
    print("Audio message sent: \(message.messageId)")
    
    // Access audio details
    if let audioData = message.data as? AmityMessageAudioData {
        print("Audio duration: \(audioData.duration) seconds")
        print("File size: \(audioData.fileSize) bytes")
    }
} catch {
    // Handle upload or creation error
    print("Failed to send audio: \(error)")
}
Automatic Processing: Mobile SDKs handle audio upload and format optimization automatically, providing seamless user experience with progress tracking.

Audio Message Features

Comprehensive audio format support and quality optionsSupported Formats
  • MP3: Universal compatibility, excellent compression, ideal for voice and music
  • WAV: Uncompressed quality, perfect for high-fidelity recordings
  • Format Conversion: Automatic optimization for web delivery when needed
Quality Options
  • Voice Optimized: 64-128kbps for clear voice recordings
  • Standard Quality: 128-192kbps for general audio content
  • High Quality: 256-320kbps for music and detailed audio

Video Messages

Video content Share video recordings and visual content

File Messages

Document sharing Send files, documents, and attachments
Implementation Strategy: Start with basic audio messaging using platform-specific patterns (unified upload for mobile, two-step for web), then add recording capabilities, transcription features, and advanced metadata. Always validate audio formats and implement proper progress feedback for optimal user experience.