med

Microbial biofilms in bioremediation and wastewater treatment / editors, Y.V. Nancharaiah, Biofouling and Biofilm Processes Section, Water and Steam Chemistry Division, Bhabha Atomic Research Centre, Kalpakkam, Tamil Nadu, India and Vayalam P. Venugopala

Online Resource




med

Simultaneous determination of interfacial molarities of an alcohol, bromide ion, and water during an alcohol induced microstructural transition: The difference between medium and long chain alcohols.

Soft Matter, 2020, Accepted Manuscript
DOI: 10.1039/D0SM00665C, Paper
Kaixin Yao, Lijie Sun, Xiaoxuan Ding, Yuzhao Wang, Tianze Liu, Changyao Liu, Jiajing Tan, Li Zhao, Baocai Xu, Laurence S. Romsted
The transitions between surfactant aggregate structures are triggered by changes in chemical or physical stimulations, including addition of additives. Effects of added alcohols on aggregate morphologies correlate strongly with alcohol...
The content of this RSS Feed (c) The Royal Society of Chemistry




med

Photo-tunable hydrogel mechanical heterogeneity informed by predictive transport kinetics model

Soft Matter, 2020, 16,4131-4141
DOI: 10.1039/D0SM00052C, Paper
Callie I. Higgins, Jason P. Killgore, Frank W. DelRio, Stephanie J. Bryant, Robert R. McLeod
Photo-tunable hydrogel mechanical heterogeneity using a single resin is presented here, informed by a predictive transport kinetics and swelling model.
The content of this RSS Feed (c) The Royal Society of Chemistry




med

Museum Media


 

MUSEUM MEDIA Edited by Michelle Henning

Museum Media explores the contemporary uses of diverse media in museum contexts and discusses how technology is reinventing the museum. It considers how technological changes—from photography and television through to digital mobile media—have given rise to new habits, forms of attention and behaviors. It explores how research methods can be used to understand people's relationships with media technologies and



Read More...





med

[ASAP] Plasmon-Mediated Coherent Superposition of Discrete Excitons under Strong Exciton–Plasmon Coupling in Few-Layer MoS<sub>2</sub> at Room Temperature

ACS Photonics
DOI: 10.1021/acsphotonics.0c00233




med

[ASAP] Near-Field Radiative Heat Transfer between Dissimilar Materials Mediated by Coupled Surface Phonon- and Plasmon-Polaritons

ACS Photonics
DOI: 10.1021/acsphotonics.0c00404




med

Building a Dictaphone Using Media Recorder and getUserMedia

Chris Mills brushes up his shorthand and shows how the MediaStream Recording API in modern browsers can be used to capture audio directly from the user’s device. Inching ever closer to the capabilities of native software, it truly is an exciting time to be a web developer.


The MediaStream Recording API makes it easy to record audio and/or video streams. When used with MediaDevices.getUserMedia(), it provides an easy way to record media from the user’s input devices and instantly use the result in web apps. This article shows how to use these technologies to create a fun dictaphone app.

A sample application: Web Dictaphone

To demonstrate basic usage of the MediaRecorder API, we have built a web-based dictaphone. It allows you to record snippets of audio and then play them back. It even gives you a visualisation of your device’s sound input, using the Web Audio API. We’ll just concentrate on the recording and playback functionality in this article, for brevity’s sake.

You can see this demo running live, or grab the source code on GitHub. This has pretty good support on modern desktop browsers, but pretty patchy support on mobile browsers currently.

Basic app setup

To grab the media stream we want to capture, we use getUserMedia(). We then use the MediaRecorder API to record the stream, and output each recorded snippet into the source of a generated <audio> element so it can be played back.

We’ll first declare some variables for the record and stop buttons, and the <article> that will contain the generated audio players:

const record = document.querySelector('.record');
const stop = document.querySelector('.stop');
const soundClips = document.querySelector('.sound-clips');

Next, we set up the basic getUserMedia structure:

if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
   console.log('getUserMedia supported.');
   navigator.mediaDevices.getUserMedia (
      // constraints - only audio needed for this app
      {
         audio: true
      })

      // Success callback
      .then(function(stream) {

      })

      // Error callback
      .catch(function(err) {
         console.log('The following `getUserMedia` error occured: ' + err);
      }
   );
} else {
   console.log('getUserMedia not supported on your browser!');
}

The whole thing is wrapped in a test that checks whether getUserMedia is supported before running anything else. Next, we call getUserMedia() and inside it define:

  • The constraints: Only audio is to be captured for our dictaphone.
  • The success callback: This code is run once the getUserMedia call has been completed successfully.
  • The error/failure callback: The code is run if the getUserMedia call fails for whatever reason.

Note: All of the code below is found inside the getUserMedia success callback in the finished version.

Capturing the media stream

Once getUserMedia has created a media stream successfully, you create a new Media Recorder instance with the MediaRecorder() constructor and pass it the stream directly. This is your entry point into using the MediaRecorder API — the stream is now ready to be captured into a <Blob>, in the default encoding format of your browser.

const mediaRecorder = new MediaRecorder(stream);

There are a series of methods available in the MediaRecorder interface that allow you to control recording of the media stream; in Web Dictaphone we just make use of two, and listen to some events. First of all, MediaRecorder.start() is used to start recording the stream once the record button is pressed:

record.onclick = function() {
  mediaRecorder.start();
  console.log(mediaRecorder.state);
  console.log("recorder started");
  record.style.background = "red";
  record.style.color = "black";
}

When the MediaRecorder is recording, the MediaRecorder.state property will return a value of “recording”.

As recording progresses, we need to collect the audio data. We register an event handler to do this using mediaRecorder.ondataavailable:

let chunks = [];

mediaRecorder.ondataavailable = function(e) {
  chunks.push(e.data);
}

Last, we use the MediaRecorder.stop() method to stop the recording when the stop button is pressed, and finalize the Blob ready for use somewhere else in our application.

stop.onclick = function() {
  mediaRecorder.stop();
  console.log(mediaRecorder.state);
  console.log("recorder stopped");
  record.style.background = "";
  record.style.color = "";
}

Note that the recording may also stop naturally if the media stream ends (e.g. if you were grabbing a song track and the track ended, or the user stopped sharing their microphone).

Grabbing and using the blob

When recording has stopped, the state property returns a value of “inactive”, and a stop event is fired. We register an event handler for this using mediaRecorder.onstop, and construct our blob there from all the chunks we have received:

mediaRecorder.onstop = function(e) {
  console.log("recorder stopped");

  const clipName = prompt('Enter a name for your sound clip');

  const clipContainer = document.createElement('article');
  const clipLabel = document.createElement('p');
  const audio = document.createElement('audio');
  const deleteButton = document.createElement('button');

  clipContainer.classList.add('clip');
  audio.setAttribute('controls', '');
  deleteButton.innerHTML = "Delete";
  clipLabel.innerHTML = clipName;

  clipContainer.appendChild(audio);
  clipContainer.appendChild(clipLabel);
  clipContainer.appendChild(deleteButton);
  soundClips.appendChild(clipContainer);

  const blob = new Blob(chunks, { 'type' : 'audio/ogg; codecs=opus' });
  chunks = [];
  const audioURL = window.URL.createObjectURL(blob);
  audio.src = audioURL;

  deleteButton.onclick = function(e) {
    let evtTgt = e.target;
    evtTgt.parentNode.parentNode.removeChild(evtTgt.parentNode);
  }
}

Let’s go through the above code and look at what’s happening.

First, we display a prompt asking the user to name their clip.

Next, we create an HTML structure like the following, inserting it into our clip container, which is an <article> element.

<article class="clip">
  <audio controls></audio>
  <p>_your clip name_</p>
  <button>Delete</button>
</article>

After that, we create a combined Blob out of the recorded audio chunks, and create an object URL pointing to it, using window.URL.createObjectURL(blob). We then set the value of the <audio> element’s src attribute to the object URL, so that when the play button is pressed on the audio player, it will play the Blob.

Finally, we set an onclick handler on the delete button to be a function that deletes the whole clip HTML structure.

So that’s basically it — we have a rough and ready dictaphone. Have fun recording those Christmas jingles! As a reminder, you can find the source code, and see it running live, on the MDN GitHub.


This article is based on Using the MediaStream Recording API by Mozilla Contributors, and is licensed under CC-BY-SA 2.5.


About the author

Chris Mills manages the MDN web docs writers’ team at Mozilla, which involves spreadsheets, meetings, writing docs and demos about open web technologies, and occasional tech talks at conferences and universities. He used to work for Opera and W3C, and enjoys playing heavy metal drums and drinking good beer.

More articles by Chris




med

FOOD MARKETING INSTITUTE v. ARGUS LEADER MEDIA. Decided 06/24/2019




med

Japan rearmed: the politics of military power / Sheila A. Smith

Online Resource




med

The suspect: an Olympic bombing, the FBI, the media, and Richard Jewell, the man caught in the middle / Kent Alexander & Kevin Salwen

Dewey Library - HV8079.B62 A44 2019




med

Sikkim sets up cell to monitor social media content

The move was made to counter any hate propaganda and rumors that may take place.




med

Fodder Scam: Day before verdict, RJD prays, Lalu Yadav skirts media

The question of who would replace Lalu as RJD chief should he be convicted was not considered.




med

Cyclone Phailin: Antony asks armed forces to be ready

IAF assets have been kept on stand by at various bases, including Raipur and Gwalior.




med

Gehlot criticises Raje for 'fake free medicines' remark

Ghelot accused Vasundhara Raje of trying to misguide and demoralise people .




med

Narendra Modi, L K Advani come together for an event in Ahmedabad

Advani was seen at a major public function along with Modi in Gujarat after 2011.




med

Oomen Chandy hurt in stone-pelting in Kannur, LDF workers blamed

Chandy was attacked at the venue of a police sports meet and suffered bruises on the forehead.




med

Now, Ahmedabad girl files complaint of rape against Asaram

Alleged victim came to Surat along with Ahmedabad police and registered her statements.




med

Delhi shamed again: One-year-old girl assaulted, raped in Shankar Vihar

Incident took place at domestic help quarters of residential complex for serving Defence officials.




med

Advances in electric power and energy systems : load and price forecasting / edited by Mohamed E. El-Hawary




med

Fundamentals of site remediation : for metal and hydrocarbon-contaminated soils / John Pichtel

Pichtel, John, 1957- author




med

Fixed it : violence and the representation of women in the media / Jane Gilmore

Gilmore, Jane, author




med

New media and intercultural communication : identity, community, and politics / edited by Pauline Hope Cheong, Judith N. Martin, Leah P. Macfadyen




med

Mamata attacks media for ‘fabricating’ Binpur turnout



  • Cities
  • DO NOT USE West Bengal

med

Media houses criticising us to please Delhi: Mamata Banerjee



  • DO NOT USE West Bengal
  • India

med

Mamata snaps back at media when asked about businessman’s detention



  • DO NOT USE West Bengal
  • India

med

BJP seeks to promote newly-formed cells



  • DO NOT USE West Bengal
  • India

med

No interference with media freedom: Calcutta High Court



  • DO NOT USE West Bengal
  • India

med

WB: Media associations condemn attack during Municipal elections



  • DO NOT USE West Bengal
  • India

med

An electrochemical study of oxidative dissolution of synthetic nickel-iron-sulphide minerals in aqueous media [electronic resource] / by Terence Edwin Warner

Warner, Terence E., 1960-




med

The kinetics of the dissolution of chalcopyrite in chloride media / Lilian De Lourdes Velásquez Yévenes

Velásquez Yévenes, Lilian de Lourdes




med

Nanobubble enhanced froth flotation process / Ahmed Sobhy

Sobhy, Ahmed, author




med

CII seeks ₹15 lakh crore as immediate stimulus package

Suggests ₹2 lakh crore cash transfer to JAM account holders




med

104 JSJ Hypermedia APIs with Steve Klabnik

The panelists discuss hypermedia APIs with Steve Klabnik




med

The young and the digital [electronic resource] : what the migration to social-network sites, games, and anytime, anywhere media means for our future / S. Craig Watkins

Watkins, S. Craig (Samuel Craig)




med

Young British muslims [electronic resource] : identity, culture, politics and the media / Nahid Afrose Kabir

Kabir, Nahid Afrose




med

Young people and new media [electronic resource] : childhood and the changing media environment / Sonia Livingstone

Livingstone, Sonia M




med

Youth and age in the medieval north [electronic resource] / edited by Shannon Lewis-Simpson




med

Youth, media and culture in the Asia Pacific region [electronic resource] / edited by Usha M. Rodrigues and Belinda Smaill




med

Zarathustra and the ethical ideal [electronic resource] : timely meditations on philosophy / Robert H. Cousineau

Cousineau, Robert Henri




med

Zen and the brain [electronic resource] : toward an understanding of meditation and consciousness / James H. Austin

Austin, James H., 1925-




med

Zen-brain reflections [electronic resource] : reviewing recent developments in meditation and states of consciousness / James H. Austin

Austin, James H., 1925-




med

Latin American technopoetics: scientific explorations in new media / Scott Weintraub

Dewey Library - PQ7082.P7 W45 2018




med

[ASAP] Highly Ordered Two-Dimensional MoS<sub>2</sub> Archimedean Scroll Bragg Reflectors as Chromatically Adaptive Fibers

Nano Letters
DOI: 10.1021/acs.nanolett.9b05004




med

Economic incentives for marine and coastal conservation : prospects, challenges and policy implications / edited by Essam Yassin Mohammed




med

Pollution status, environmental protection, and renewable energy production in marine systems / Ahmed El Nemr, editor




med

Marine pollution and microbial remediation / Milind Mohan Naik, Santosh Kumar Dubey, editors




med

HC suspends decision to surrender medical PG diploma courses

This is not the way to treat govt. doctors, observes bench




med

Visible-light mediated oxidative ring expansion of anellated cyclopropanes to fused endoperoxides with antimalarial activity

Org. Chem. Front., 2020, Advance Article
DOI: 10.1039/D0QO00168F, Research Article
Simon Budde, Felix Goerdeler, Johannes Floß, Peter Kreitmeier, Elliot F. Hicks, Oren Moscovitz, Peter H. Seeberger, Huw M. L. Davies, Oliver Reiser
Hetero- and carbocyclic anellated cyclopropanes were converted in one step by a visible light induced photooxidation to their corresponding polycyclic endoperoxides, which show promising antimalarial activity.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




med

Organocatalytic 1,5-trifluoromethylthio-sulfonylation of vinylcyclopropane mediated by visible light in the water phase

Org. Chem. Front., 2020, Advance Article
DOI: 10.1039/D0QO00343C, Research Article
Junkai Liu, Hong Yao, Xinnan Li, Hongyu Wu, Aijun Lin, Hequan Yao, Jinyi Xu, Shengtao Xu
1,2-Difunctionalization has developed into a robust tool for the preparation of complex organic molecules, and remote difunctionalization has also aroused widespread interest to achieve pluripotency of difunctionalization.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry