Signals and systems : analysis using transform methods and MATLAB / Michael J. Roberts
Data mining and data warehousing : principles and practical techniques / Parteek Bhatia
Emerging perspectives in big data warehousing / David Taniar, Monash University, Australia, Wenny Rahayu, La Trobe University, Australia
Business standard compliance and requirements validation using goal models / Novarun Deb, Nabendu Chaki
[ASAP] Advanced Liquid Chromatography of Polyolefins Using Simultaneous Solvent and Temperature Gradients
[ASAP] Temporal-Spatial-Color Multiresolved Chemiluminescence Imaging for Multiplex Immunoassays Using a Smartphone Coupled with Microfluidic Chip
[ASAP] Characterizing and Quantitating Therapeutic Tethered Multimeric Antibody Degradation Using Affinity Capture Mass Spectrometry
[ASAP] Rapid and Sensitive Detection of anti-SARS-CoV-2 IgG, Using Lanthanide-Doped Nanoparticles-Based Lateral Flow Immunoassay
[ASAP] Sensitive Top-Down Proteomics Analysis of a Low Number of Mammalian Cells Using a Nanodroplet Sample Processing Platform
[ASAP] Discovering New Lipidomic Features Using Cell Type Specific Fluorophore Expression to Provide Spatial and Biological Specificity in a Multimodal Workflow with MALDI Imaging Mass Spectrometry
[ASAP] Counterflow Gradient Focusing in Free-Flow Electrophoresis for Protein Fractionation
[ASAP] Collision-Induced Unfolding Studies of Proteins and Protein Complexes using Drift Tube Ion Mobility-Mass Spectrometer
[ASAP] Hydration Structure and Hydrolysis of U(IV) and Np(IV) Ions: A Comparative Density Functional Study Using a Modified Continuum Solvation Approach
[ASAP] Predicting Deprotonation Sites Using Alchemical Derivatives
[ASAP] Using Machine Learning to Predict the Dissociation Energy of Organic Carbonyls
[ASAP] The Conformational Landscape, Internal Rotation, and Structure of 1,3,5-Trisilapentane using Broadband Rotational Spectroscopy and Quantum Chemical Calculations
Metrics for Assessing Physician Activity Using Electronic Health Record Log Data
Electronic health record (EHR) log data have shown promise in measuring physician time spent on clinical activities, contributing to deeper understanding and further optimization of the clinical environment.
Housing reform and China's real estate industry: review and forecast / Pengfei Ni, Linhua Zou, Guangchun Gao, Xuemei Jiang
How to Easily Animate Website Elements on Scroll Using the Free AOS Library
On-scroll animations can add quite the elegant effect to your website. A little animated polish can go a long way towards making your site look well-rounded and complete. With JavaScript and CSS, you can make elements fade, slide, or even …
Template-based fabrication of spatially organized 3D bioactive constructs using magnetic low-concentration gelation methacrylate (GelMA) microfibers
DOI: 10.1039/C9SM01945F, Paper
A new template-based method to apply low-concentration GelMA microfibers as building blocks for higher-order cellular assembly.
The content of this RSS Feed (c) The Royal Society of Chemistry
Inverse leidenfrost drop manipulation using menisci
DOI: 10.1039/C9SM02363A, Paper
The motion of droplets levitated above a liquid surface is controlled using the menisci rising against partially immersed walls.
The content of this RSS Feed (c) The Royal Society of Chemistry
Using microprojectiles to study the ballistic limit of polymer thin films
DOI: 10.1039/D0SM00295J, Communication
In this work, a microballistic impact test called laser induced projectile impact test (LIPIT) was used to study the perforation behavior of polycarbonate thin films to demonstrate the importance of film thickness on the film's ballistic limit.
The content of this RSS Feed (c) The Royal Society of Chemistry
Rapid analysis of cell-generated forces within a multicellular aggregate using microsphere-based traction force microscopy
DOI: 10.1039/C9SM02377A, Paper
We measure cell-generated forces from the deformations of elastic microspheres embedded within multicellular aggregates. Using a computationally efficient analytical model, we directly obtain the full 3D mapping of surface stresses within minutes.
The content of this RSS Feed (c) The Royal Society of Chemistry
Systematic approach for wettability prediction using molecular dynamics simulations
DOI: 10.1039/D0SM00197J, Paper
An efficient approach for fast screening of liquids in terms of their wetting properties.
The content of this RSS Feed (c) The Royal Society of Chemistry
Structural characterization of fibrous synthetic hydrogels using fluorescence microscopy
DOI: 10.1039/C9SM01828J, Paper
The structural features of the matrix surrounding the cells play a crucial role in regulating their behavior.
The content of this RSS Feed (c) The Royal Society of Chemistry
Investigation of Thermal Conductivity for Liquid Metal Composites Using Micromechanics-Based Mean-Field Homogenization Theory
DOI: 10.1039/D0SM00279H, Paper
For the facile use of liquid metal composite (LMC) for soft, stretchable and thermal systems, it is crucial to understand and predict the thermal conductivity of the composite as a...
The content of this RSS Feed (c) The Royal Society of Chemistry
[ASAP] Describing Meta-Atoms Using the Exact Higher-Order Polarizability Tensors
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.
Small-time actress held for threatening and abusing cops
Aarushi murder case: Talwars using dilatory tactics, says SC rejecting their plea
Computing in algebraic geometry [electronic resource] : a quick start using SINGULAR / Wolfram Decker, Christoph Lossen
Dynamical systems with applications using mathematica [electronic resource] / Stephen Lynch
Current and future impacts of climate change on housing, buildings and infrastructure / The Senate, Environment and Communications References Committee
Apple to pay $18 mn to settle suit accusing it of breaking FaceTime: Report
Over 3.6 million devices are said to have been affected by the iOS 6 update and each class member will receive an estimated $3
Apple, Google ban GPS tracking in apps using contract tracing framework
Both companies said privacy and preventing governments from using the system to compile data on citizens was a primary goal
140 JSJ Using Art to Get and Keep People Interested in Programming with Jenn Schiffer
The panelists talk to Jenn Schiffer about using art to get and keep people interested in programming.
JSJ 393: Why You Should Be Using Web Workers with Surma
Episode Summary
Surma is an open web advocate for Google currently working with WebAssembly team. He was invited on the show today to talk about using web workers and how to move work away from the browser’s main thread. His primary platform is bringing multithreading out of the fringes and into the web.
The panel talks about their past experience with web workers, and many of them found them isolated and difficult to use. Surma believes that web workers should pretty much always be sued because the main thread is an inherently bad place to run your code because it has to do so much. Surma details the differences between web workers, service workers, and worklets and explains what the compositer is.
The panel discusses what parts should be moved off the main thread and how to move the logic over. Surma notes that the additional cost of using a worker is basically nonexistent, changes almost nothing in your workflow, and takes up only one kilobyte of memory. Therefore, the cost/benefit ratio of using web workers gets very large. They discuss debugging in a web worker and Surma details how debugging is better in web workers.
Surma wants to see people use workers not because it will make it faster, but because it will make your app more resilient across all devices. Every piece of JavaScript you run could be the straw that breaks the camel’s back. There’s so much to do on the main thread for the browser, especially when it has a weaker processor, that the more stuff you can move away, the better.
The web is tailored for the most powerful phones, but a large portion of the population does not have the most powerful phone available, and moving things over to a web worker will benefit the average phone. Surma talks about his experience using the Nokia 2, on which simple apps run very slow because they are not being frugal with the user’s resources. Moving things to another thread will help phones like this run faster.
The panel discusses the benefit of using web workers from a business standpoint. The argument is similar to that for accessibility. Though a user may not need that accessibility all the time, they could become in need of it. Making the app run better on low end devices will also increase the target audience, which is helpful is user acquisition is your principle metric for success.
Surma wants businesses to understand that while this is beneficial for people in countries like India, there is also a very wide spectrum of phone performance in America. He wants to help all of these people and wants companies acknowledge this spectrum and to look at the benefits of using web workers to improve performance.
Panelists
-
Charles Max Wood
-
Christopher Buecheler
-
Aimee Knight
-
AJ O’Neal
With special guest: Surma
Sponsors
-
Sentry use the code “devchat” for 2 months free on Sentry’s small plan
Links
Follow DevChatTV on Facebook and Twitter
Picks
Charles Max Wood:
Surma:
-
Follow Surma @DasSurma on Twitter and at dassur.ma
AJ O’Neal:
Christopher Buecheler
Zenoss core 3.x network and system monitoring [electronic resource] : a step-by-step guide to configuring, using, and adapting this free Open Source network monitoring system / Michael Badger
Zenoss Core network and system monitoring [electronic resource] : a step-by-step guide to configuring, using, and adapting the free open-source network monitoring system / Michael Badger
Predicting Pulmonary to Systemic Flow Ratio Using Chest Radiograph in Congenital Heart Disease
This study develops and validates a quantitative method to predict the pulmonary to systemic flow ratio in patients with congenital heart disease from chest radiographs using deep learning.
Identification of Cardiovascular Monosodium Urate Crystal Deposition in Gout Using Dual-Energy CT
To the Editor We read the recent article by Klauser et al with great interest. While the potential implications of the findings are exciting, we have several concerns. First, the authors do not explicitly state whether electrocardiogram gating was used in their study. This is an important detail because cardiac motion artifact is a source of artifactual coloration with dual-energy computed tomography (DECT), particularly with dual-source scanners given the approximately 80-millisecond temporal difference between the 2 radiography beams. Furthermore, beam hardening artifact from calcified atheromas and partial volume effect, known sources of artifacts in the 2-material decomposition algorithm of DECT, may largely explain the findings. While patients with gout had higher prevalence of coronary calcification (55 of 59 patients [93%]) and cardiovascular monosodium urate (MSU) deposition (51 of 59 patients [86%]) than controls, the authors do not report whether the 4 patients with gout without coronary calcifications exhibited MSU deposition nor the number of controls or cadaveric hearts with coronary calcification. The images from the article show areas of green pixelization occurring adjacent to calcified plaques on grayscale computed tomography images (eg, Figure 2A and D, left anterior descending artery [yellow arrowhead]), which would favor this artifact hypothesis without additional data.
Identification of Cardiovascular Monosodium Urate Crystal Deposition in Gout Using Dual-Energy CT—Reply
In Reply We appreciate the valuable comments of Becce et al on our article. We applied prospective electrocardiography gating using a thin-slice cardiac protocol to ensure highest spatial resolution with minimal motion artifact. A noncontrast electrocardiography-gated computed tomography (CT) examination with standardized scan parameters was performed using a 128-slice dual-source CT (SOMATOM Definition Flash; Siemens) with a detector collimation of 2 × 64 × 0.6 mm, rotation time of 0.28 seconds, and prospective electrocardiography triggering for heart rates less than 65 beats per minute (diastolic padding, 70% of RR interval) and more than 65 beats per minute (systolic padding, 40% of RR interval). Axial images were reconstructed with 0.75-mm slice width, increment of 0.5, and a medium-smooth convolution kernel (B26f). When motion artifact was present, it was distinguished by visual analysis of an experienced observer and colorized pixels related to motion were excluded.
[ASAP] Fast Magneto-Ionic Switching of Interface Anisotropy Using Yttria-Stabilized Zirconia Gate Oxide
[ASAP] Overcoming Hypoxia-Restrained Radiotherapy Using an Erythrocyte-Inspired and Glucose-Activatable Platform
Topomeric aza/thia cryptands: synthesis and theoretical aspects of in/out isomerism using n-alkyl bridging
DOI: 10.1039/D0QO00123F, Research Article
A series of heterobicyclic aza/thia-lactams and cryptands incorporating changes in n-alkyl bridging length have been synthesized, characterized, chelated to heavy metals and computationally assessed.
The content of this RSS Feed (c) The Royal Society of Chemistry
Targeted Isolation of Two Disesquiterpenoids Macrocephadiolides A and B from Ainsliaea macrocephala using Molecular Networking-based Dereplication Strategy
DOI: 10.1039/D0QO00030B, Research Article
A molecular networking-based dereplication strategy was applied to the phytochemical investigation of Ainsliaea macrocephala, leading to the isolation of two novel disesquiterpenoids macrocephadiolides A (1) and B (2). Their structures,...
The content of this RSS Feed (c) The Royal Society of Chemistry