NIP-A0: Voice Messages (#1984)
This commit is contained in:
parent
074b8eeb01
commit
e50f37a527
|
@ -0,0 +1,60 @@
|
|||
NIP-A0
|
||||
======
|
||||
|
||||
Voice Messages
|
||||
-----------
|
||||
|
||||
**Status:** Draft
|
||||
|
||||
This NIP defines new events `kind: 1222` for root messages and `kind: 1244` for reply messages to be used for short voice messages, typically up to 60 seconds in length.
|
||||
|
||||
## Specification
|
||||
|
||||
### Event Kind `1222` and Kind `1244`
|
||||
|
||||
The `kind: 1222` event is defined as follows:
|
||||
|
||||
- `content`: MUST be a URL pointing directly to an audio file.
|
||||
- The audio file SHOULD be in `audio/webm` format. Clients MAY support other common audio formats like `audio/ogg`, `audio/mp4` (m4a), or `audio/mpeg` (mp3), but `audio/webm` is recommended for broad compatibility and efficiency.
|
||||
- The audio duration SHOULD be no longer than 60 seconds. Clients publishing `kind: 1222` events SHOULD enforce this limit or provide a clear warning to the user if exceeded.
|
||||
- `tags`:
|
||||
- Tags MAY be included as per other NIPs (e.g., `t` for hashtags, `g` for geohash, etc.).
|
||||
|
||||
The `kind: 1244` event is defined as follows:
|
||||
|
||||
- To be used for replies, `kind: 1244` events MUST follow the structure of `NIP-22`.
|
||||
- `content`: MUST be a URL pointing directly to an audio file.
|
||||
- The audio file SHOULD be in `audio/webm` format. Clients MAY support other common audio formats like `audio/ogg`, `audio/mp4` (m4a), or `audio/mpeg` (mp3), but `audio/webm` is recommended for broad compatibility and efficiency.
|
||||
- The audio duration SHOULD be no longer than 60 seconds. Clients publishing `kind: 1222` events SHOULD enforce this limit or provide a clear warning to the user if exceeded.
|
||||
- `tags`:
|
||||
- Tags MAY be included as per other NIPs (e.g., `t` for hashtags, `g` for geohash, etc.).
|
||||
|
||||
|
||||
## Visual representation with `imeta` (NIP-92) tag (optional)
|
||||
|
||||
The following imeta (NIP-92) tags MAY be included so clients can render a visual preview without having to download the audio file first:
|
||||
|
||||
- `waveform`: amplitude values over time, space separated, less than 100 values should be enough to render a nice visual
|
||||
- `duration`: audio length in seconds
|
||||
|
||||
## Examples
|
||||
|
||||
### Root Voice Message Example
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "https://blossom.primal.net/5fe7df0e46ee6b14b5a8b8b92939e84e3ca5e3950eb630299742325d5ed9891b.mp4",
|
||||
"created_at": 1752501052,
|
||||
"id": "...",
|
||||
"kind": 1222,
|
||||
"pubkey": "...",
|
||||
"sig": "...",
|
||||
"tags": [
|
||||
[
|
||||
"imeta",
|
||||
"url https://blossom.primal.net/5fe7df0e46ee6b14b5a8b8b92939e84e3ca5e3950eb630299742325d5ed9891b.mp4",
|
||||
"waveform 0 0.05 0.27 0.08 0.01 0.01 0.01 0.03 0.38 1.5 0.49 0.02 0.28 0.04 0.01 0 0 0.39 0.22 0.16 0.05 0.06 0.55 0.01 0.06 0.01 0 0 0.02 0.61 0.02 0.07 0.01 0.21 0.09 0.12 0.63 0.01 0.02 0.02 0.42 0.02 0.68 0.05 0.02 0.05 0.02 0 0 0 0",
|
||||
"duration 8"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -102,6 +102,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||
- [NIP-96: HTTP File Storage Integration](96.md)
|
||||
- [NIP-98: HTTP Auth](98.md)
|
||||
- [NIP-99: Classified Listings](99.md)
|
||||
- [NIP-A1: Voice Messages](A0.md)
|
||||
- [NIP-B0: Web Bookmarks](B0.md)
|
||||
- [NIP-B7: Blossom](B7.md)
|
||||
- [NIP-C0: Code Snippets](C0.md)
|
||||
|
@ -151,6 +152,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||
| `1063` | File Metadata | [94](94.md) |
|
||||
| `1068` | Poll | [88](88.md) |
|
||||
| `1111` | Comment | [22](22.md) |
|
||||
| `1222` | Voice Message | [A0](A0.md) |
|
||||
| `1244` | Voice Message Comment | [A0](A0.md) |
|
||||
| `1311` | Live Chat Message | [53](53.md) |
|
||||
| `1337` | Code Snippet | [C0](C0.md) |
|
||||
| `1617` | Patches | [34](34.md) |
|
||||
|
|
Loading…
Reference in New Issue