import {AudioMetadata} from './common';

export const getMetadataFromUrl = async (audioUrl?: string) => {
  if (typeof audioUrl === 'undefined') {
    return {} as Partial<AudioMetadata>;
  }

  if (typeof window !== 'undefined') {
    const { getMetadataFromUrl: client } = await import('./client');
    return client(audioUrl);
  }

  // TODO server side
  return {} as Partial<AudioMetadata>;
};

export * from './common';
