Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@carbonenginejs/tools-browser

Browser-facing CarbonEngineJS clients, remote readers, and application tools.

Use this package when a useful browser implementation does not belong in a runtime library. Shared primitives remain in @carbonenginejs/runtime-utils; audio graph semantics and resource formats remain in their owning runtime packages. Node acquisition, servers, credentials, and persistent caches remain in @carbonenginejs/tools-core.

Install

npm install @carbonenginejs/tools-browser

Quick start

Parse caller-supplied file-index text without filesystem access:

import {
    CjsFileIndex
} from "@carbonenginejs/tools-browser/fileindex";

const index = CjsFileIndex.parseResFileIndex(
    "res:/graphics/example.red,objects/example.red"
);
const entry = index.Find("res:/graphics/example.red");

console.log(entry.location);

Read a complete schema-v2 audio library from a remote endpoint:

import {
    CjsAudioLibrary
} from "@carbonenginejs/tools-browser/audio";

const library = new CjsAudioLibrary({
    fetch
});
const audioLibraryDocument = await library.ReadDocument(
    "https://example.invalid/eve/3435006/audio/library"
);

Use the same object as CjsAudioMan's remote media provider:

import {
    CjsAudioMan
} from "@carbonenginejs/runtime-audio";

const audio = new CjsAudioMan(audioLibraryDocument, {
    mediaProvider: library
});

The browser tool does not build, select, decode, or cache audio. It can package caller-selected remote index rows, SoundbanksInfo, and optional neutral enrichment for the optional @carbonenginejs/runtime-audio/library-builder; it can also read complete files and exact ranges for the runtime provider contract.

The root export is available when an application consumes several tool families. Targeted ./audio, ./chat, ./fileindex, and ./realtime imports remain available. Node hosts and protocol tools that need only the side-effect-free wire constants and structural validators use ./realtime/wire.

Documentation

License

MIT. See LICENSE and NOTICE.

About

🐔 CarbonEngineJS optional and example libraries

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages